Author Topic: Caret not showing on devices  (Read 9456 times)

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Caret not showing on devices
« on: March 07, 2014, 03:53:57 AM »
Hi, I'm not sure if I'm doing something wrong, but I'm not able to show up the caret in an UIInput textfield on IOS and Android. It's working in simulator but not on devices. I can write normally but nothing is blinking... any suggestions?

Thanks alot.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Caret not showing on devices
« Reply #1 on: March 07, 2014, 09:16:17 AM »
There is no way to obtain the caret position and selection from the OS in Unity, so the NGUI caret and selection is not used on mobile devices. You already have an input field that comes with your iOS/Android OS -- it has both selection and caret.

Ugur

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 60
    • View Profile
Re: Caret not showing on devices
« Reply #2 on: April 20, 2014, 03:36:35 PM »
This doesn't make sense to me, i mean i show the UIInput and want to show the input field in ngui and hide the native input textfield, what good is an input textfield if it doesn't even show a caret to indicate where one is editing it?
Why can't you on mobile just show it at the current position of the label if it is selected (where you also add the next letter typed) ?

Ugur

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 60
    • View Profile
Re: Caret not showing on devices
« Reply #3 on: April 20, 2014, 04:01:21 PM »
I changed the UIInput.cs quickly now to on mobile just show the caret where the last letter of the textfield is, yes it doesnt show a selection range, but still, imho way better than not having a blinking caret shown at all =)
Would be cool if you could add something like this in NGUI so i don't have to edit the builtin class again after the next update =)

http://www.stimunation.com/betatests/NGUI/UIInputWithCaretOnMobile.zip