Author Topic: iPhone keyboard hides NGUI input text field  (Read 3196 times)

kenuab

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
iPhone keyboard hides NGUI input text field
« on: September 01, 2013, 05:44:53 PM »
There's a lot on this on other forums, for example:

http://blog.seancarpenter.net/2012/10/15/scrolling-a-uitableview-when-displaying-the-keyboard/

but is there a simple fix for this within NGUI?  It seems like there ought to be a check box for it in UIInput (& UIInputSaved).

Thanks!

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: iPhone keyboard hides NGUI input text field
« Reply #1 on: September 03, 2013, 03:53:03 AM »
In that link you posted, that is surely a design issue with the system and not a fault of NGUI?
Why not just add an OnClick event that scrolls the touch area up to the top half of the screen?

kenuab

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: iPhone keyboard hides NGUI input text field
« Reply #2 on: September 03, 2013, 09:20:24 AM »
Thanks, Enay, yes, I agree, it is a system problem, not a fault of NGUI. 

Here's how I used your OnClick suggestion: I created a table of 5 input rows with the UITable script and checked the sort option.  Named the rows Row2, Row3, etc, reserving Row1.  Then, in the OnClick event (I'm using Playmaker to program this), I rename whatever input row is clicked to Row1 which, because of the sort function of UITable, moves whatever row was clicked to the top and therefore above the iPhone keyboard.  When the user hits return, ending input, I rename the input row back to its original name which, again because of sort, moves it back to its original position. 

Perhaps not too elegant a solution, since it doesn't really scroll as you suggested, but it works.  Is there a simple way to scroll the screen instead which I am missing?

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: iPhone keyboard hides NGUI input text field
« Reply #3 on: September 04, 2013, 02:56:54 AM »
That is similar to the approach we used. NGUI is awesome, it does so much. But it doesn't do everything.

Remember you need to do some stuff, and plan for yourself. For example, if you are planning on compiling to iPad, you can set the keyboard to appear at the left and right hand side of the screen. What happens on your software should that happen? Best to prepare for all eventualities :)

kenuab

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: iPhone keyboard hides NGUI input text field
« Reply #4 on: September 04, 2013, 08:05:31 AM »
Good tip re: iPad.  I am working on an iPad version.  :)