Author Topic: UIInput iOS Keyboard & Auto Camera Movement  (Read 4644 times)

FizzPow

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 83
    • View Profile
    • FizzPow Games
UIInput iOS Keyboard & Auto Camera Movement
« on: March 17, 2013, 01:02:31 AM »
Hello.  I have a simple 3 field signup form on my iOS app.  I'd like to detect when the user is entering data into a specific field and then adjust the camera (or something) so that the each field is still visible to the user when the iOS keyboard pops up, like most iOS apps seem to do.  What's the best way to accomplish this?  Secondly, but not as important, is there any way to show the "next" button on the iOS keyboard and have it move to the next field.  Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput iOS Keyboard & Auto Camera Movement
« Reply #1 on: March 17, 2013, 09:13:55 AM »
UICamera.selectedObject will point to the game object containing the input field you're working with. In OnSubmit callback on your input, simply UIInput.selected = true on the next field.

FizzPow

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 83
    • View Profile
    • FizzPow Games
Re: UIInput iOS Keyboard & Auto Camera Movement
« Reply #2 on: March 18, 2013, 11:24:15 AM »
Ah great, thank you!

FizzPow

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 83
    • View Profile
    • FizzPow Games
Re: UIInput iOS Keyboard & Auto Camera Movement
« Reply #3 on: March 19, 2013, 11:28:25 PM »
So I ran into an issue.  Here's my Event Receiver on my email field:

  1.     void OnSubmitEmail(string text)
  2.     {
  3.         Debug.Log("OnSubmitEmail: " + text);
  4.         inputPW1.selected = true;
  5.     }
  6.  

inputPW1 highlights for a split second and leaves a carat there but it jumps immediately back to my email field?