Hello Guest

Author Topic: Shift UI for text input (Mobile)  (Read 4372 times)

kujo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Shift UI for text input (Mobile)
« on: November 11, 2013, 05:53:33 pm »
Hi,

I've had a search around, but can't find anything on this subject.

I've set up a UI in which text input is required. Everything works great except I need to "shift" the UI up so that the user can see what they're typing in the text box, as the keyboard covers that part of the screen.

Anyone any advice on how to do this? I know how to do it on Android and iOS, but don't really know where to start with it in Unity.

Thanks in advanced!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Shift UI for text input (Mobile)
« Reply #1 on: November 11, 2013, 09:28:02 pm »
You'll have to do it yourself. Attach all your UI to a game object, and then move this game object up or down when you need to shift it.

kujo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Shift UI for text input (Mobile)
« Reply #2 on: November 12, 2013, 08:42:23 am »
Thats cool - Is there an event I can listen to when the text box gets or when the keyboard will appear?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Shift UI for text input (Mobile)
« Reply #3 on: November 12, 2013, 09:50:12 am »
No, but you can poll TouchScreenKeyboard.visible.

kujo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Shift UI for text input (Mobile)
« Reply #4 on: November 12, 2013, 10:02:10 am »
Nice one - thanks very much