Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: yevdokia on March 24, 2014, 09:27:12 AM
-
I have a login screen with 3 UIInput fields in an iPad game. When the user taps an input field, the iOS keyboard slides on and covers the input field. This seems like something that a lot of apps and games need to deal with. Is there an existing NGUI solution for moving the screen up when the keyboard comes up, or do I need to implement my own?
-
You wouldn't be moving your UI. You would adjust the Camera's Viewport Rect instead. NGUI will adjust automatically.
-
When I play with the Camera's Viewport Rect, I see the UI scale to fit within the new area, but that's not quite the effect that I want. I'd rather have it look like the UI simply moves up until the currently selected input field is above the top of the keyboard. Is there a simple way to do that?
-
If your UI is not anchored to the screen, then you can simply move some root object up (not UIRoot, but rather root of your UI):
UIRoot
- UI camera
- Root object (move this)
-- The rest of your UI is a child of the "Root object".
-
Oops! I forgot to respond to your answer. It worked! Thank you so much!
Yevdokia
-
@yevdokia: can you share some insight on how you did this? I currently facing the same 'problem'. Thank you!