Author Topic: Multiple UIInput Issues  (Read 3829 times)

Kandrew

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Multiple UIInput Issues
« on: October 31, 2014, 02:24:14 PM »
Hello, another problem,

So I'm using the UIInput for a profile creation for our game and I modified the validation to only accept lowercase and uppercase letters. I've made sure in the scene that I have the right validation selected on the enum, yet the user can input special characters and numbers on iOS devices.

Also I have the max char limit set for 7 yet it's letting 8 characters be typed and when you type another it just replaces the end character. What's the deal with that? Is there some platform difference with this?

Also, is there anyway to just only use the iOS keyboard with the blue done button? Currently the keyboards change every time uiinput comes into focus.

Note: This is all only occurs on device, works as expected in editor.

Thanks, I appreciate it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Multiple UIInput Issues
« Reply #1 on: November 01, 2014, 07:54:06 AM »
Not sure what you mean by the last part ("keyboards change"?).

You modified the validation how? You just need to set a custom validator function (UIInput.onValidate) and reject values inside. All the code for character validation callback calls as well as the character limit is inside UIInput.Validate function, around line 420.

Kandrew

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Multiple UIInput Issues
« Reply #2 on: November 03, 2014, 11:50:47 AM »
The part of the keyboards changing is that on the device we want the keyboard with the Blue done/OK button on iOS, but sometimes we are getting the one with the return button as well, does it decide this randomly unless defined somewhere?

In UIInput I modified the function named Validate() to only accept upper and lower case letters in the username if block, It seems like it may not be hitting this function altogether even though I set the Enum in editor to "Username". Does it have to be your own custom validate function?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Multiple UIInput Issues
« Reply #3 on: November 04, 2014, 09:43:31 AM »
You should be writing your own custom validation function, not modifying UIInput.

That said, nothing in NGUI is random. It will either be consistent, or not at all. If you are getting random behaviour, it suggests that there is some underlying Unity/OS issue.