Author Topic: NGUI UIInput for Mobile phone  (Read 6337 times)

NCPLnaveen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
NGUI UIInput for Mobile phone
« on: June 14, 2016, 02:00:05 AM »
Hello Everyone,
                        Few days on wards im facing some issues with UIInput, some of the issues are

           1. I have a registration(4 input text fields) and login screen( 2 Input text fields) both are working on unity editor but on mobile when i was able to type the email and password but both fields require a return key(Enter key)but enter is not present on mobile(i have been pressing the return at bottom of the mobile phone(iphone) but its not working). is they a way to direct connect to a button (like auto save with out pressing the enter key).
           2. I have a text fields and it is represented inside a image(Email box image) but when i type the text after certain length the text wont be visible or text will be crossing the image(email box image). can we solve any way.
           3. I have 2 fields one for email and other password. the mobile keyboard will cover the password fields as it is at bottom the screen. what can we do for it. thank you
« Last Edit: June 14, 2016, 02:11:37 AM by NCPLnaveen »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI UIInput for Mobile phone
« Reply #1 on: June 16, 2016, 03:43:41 AM »
1. The mobiles do have a return button. It's usually on the right hand side of the on-screen keyboard, can also be labeled "submit" or "go" -- and pressing it submits the input same as hitting Return on a keyboard. If it doesn't for you, I would question what device you are testing it on, your version of Unity and your version of NGUI. Even if you didn't, you can always add a "done" button to the screen itself. Most forms do. Username/pass, and the "Login" button for example. Clicking this button will just grab the values of username/pass input fields and proceed with the login action.

2. Change your input label's wrap settings.

3. When you get OnSubmit on the email, automatically select the password field. When you submit on the password field, automatically login.

NCPLnaveen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI UIInput for Mobile phone
« Reply #2 on: June 17, 2016, 12:40:37 AM »
Hey arenMook,
                       Right now the first part is working on mobile like when i press return key on onscreenkeyboard.but for last question. i want the screen automatically go up when we go for password textfield or else a scroll view will be prefect. but how to implement two methods. thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI UIInput for Mobile phone
« Reply #3 on: June 18, 2016, 05:07:19 AM »
Screen to go up? I don't know what you mean.

NCPLnaveen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI UIInput for Mobile phone
« Reply #4 on: June 19, 2016, 11:30:16 PM »
hey,
         Like when we touch or go to password text field the screen should automatically go up (below the password field the onscreen keyboard should be there) .

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI UIInput for Mobile phone
« Reply #5 on: June 20, 2016, 12:51:31 AM »
If you want the screen to move, you can do that by adjusting your camera's rectangle.

NCPLnaveen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI UIInput for Mobile phone
« Reply #6 on: June 24, 2016, 06:20:18 AM »
Hey,
       Im not getting screen slides up when touch the email text field or else password. other thing is how to set the UIiput 's value to string in on button click. like i have tried

public void MySubmit_email ()
   {
      emailID = UIInput.current.value;

      Debug.Log("I typed: " + UIInput.current.value);

      //UIInput.current.value = null;
   }

   public void MySubmit_password()
   {
      passWord = UIInput.current.value;

      Debug.Log("I typed: " + UIInput.current.value);

      //UIInput.current.value = null;
   }


   public void Email_Authication()
   {
                MySubmit_email ()
      MySubmit_password()
      Debug.Log ("working");
      GamedoniaUsers.LoginUserWithEmail(emailID,passWord, OnLogin);

   }

when i do it, gives NullReference exception  on emailID = UIInput.current.value; , passWord = UIInput.current.value;

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI UIInput for Mobile phone
« Reply #7 on: June 27, 2016, 06:01:07 AM »
Any "current" type reference is valid only during an appropriate NGUI callback, so of course it won't be valid in your case.

Reference the two input widgets as public fields in your class and access them directly instead of using UIInput.current.