Author Topic: UIInput without separate IOS input field  (Read 5387 times)

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
UIInput without separate IOS input field
« on: February 20, 2014, 07:45:55 AM »
Hi, I'm pretty new to Unity and NGUI and I am wondering if its possible to disable the second native text field above the overlay ios keyboard when writing into a UILabel. I talking about typing with a real device, not in the game preview. I hope, you know what I mean...?

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Re: UIInput without separate IOS input field
« Reply #1 on: February 20, 2014, 07:53:25 AM »
Try placing this somewhere "early" in your code.
  1. TouchScreenKeyboard.hideInput = true;

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: UIInput without separate IOS input field
« Reply #2 on: February 20, 2014, 11:25:02 AM »
Sounded good, but unfortunately it's not working for the normal text UILabel/UIInput. Textarea is still coming up but hidden when UILabel is in password mode. Without the code, there is a smaller Textarea coming up for password as well. So it is working half / half. Any idea?
« Last Edit: February 20, 2014, 11:32:21 AM by cyx »

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Re: UIInput without separate IOS input field
« Reply #3 on: February 20, 2014, 02:00:31 PM »
Just to be clear, you mean to disable that textfield thingy directly above the iOS keyboard like in the attachment, right?

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: UIInput without separate IOS input field
« Reply #4 on: February 21, 2014, 06:13:41 AM »
exactly, the textfield which comes from the os when opening the keyboard with "cancel" and "done". its just confusing, if you have a textfield in your game and another one above your keyboard with the same content when writing, so I wanna switch that off.

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Re: UIInput without separate IOS input field
« Reply #5 on: February 21, 2014, 06:18:57 AM »
That line of code i pasted previously should cause your keyboard to look like the one i attached. Haven't tried password mode though.  ???

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: UIInput without separate IOS input field
« Reply #6 on: February 21, 2014, 07:06:21 AM »
I added your code in a the panel script of UI Root in the Awake() methode, but nothing happens for the normal textinput field - so it's not looking like yours.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput without separate IOS input field
« Reply #7 on: February 21, 2014, 02:43:16 PM »
It needs to go into UIInput, not UIRoot. UIInput is what shows the keyboard.

The keyboard is opened on line 399 of UIInput.cs.

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: UIInput without separate IOS input field
« Reply #8 on: February 24, 2014, 04:21:07 AM »
I tried that and added the line into UIInput before Line 399 and outside the if block as well, nothing happens. I can not remove this extra textfield... aargh. Don't know whats wrong.

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: UIInput without separate IOS input field
« Reply #9 on: March 03, 2014, 10:26:58 AM »
Found a solution:

Setting max. lines for the textfield to 1 and not 0 helps. Switch works only for SINGLE LINE text fields.

Thanks anyway.