iOS TextField Constraint

67 views
Skip to first unread message

CS

unread,
Jan 9, 2014, 9:35:50 AM1/9/14
to codenameone...@googlegroups.com
Dear CNO team,

In a TextField if I select constraint "Numeric" the virtual keyboard with numbers is shown (though the constraints itself are not imposed as are in Android). The strange thing is that if I choose "Decimal" constraint, the virtual keyboard is opened as "normal" and not with numbers as is the case with "Numeric" constraint. In Android everything works as it should. Is this on purpose or …

Regards.

Shai Almog

unread,
Jan 9, 2014, 2:15:19 PM1/9/14
to codenameone...@googlegroups.com, computer.s...@gmail.com
Hi,
IOS is problematic with decimals: http://stackoverflow.com/questions/9613109/uikeyboardtypedecimalpad-with-negative-numbers
Although I'm not sure why you get the non-numeric pad. Are you using a single line text field?

computer.s...@gmail.com

unread,
Jan 10, 2014, 1:49:44 AM1/10/14
to codenameone...@googlegroups.com, computer.s...@gmail.com
Yes, just a normal, one line text field, basically it is the same as the one with numeric constraint, which properly returns numeric pad. I only added a hint and that is about it (regarding customisation).

It was tested on iPad 2 with iOS 6.1.x.


Shai Almog

unread,
Jan 10, 2014, 2:05:06 PM1/10/14
to codenameone...@googlegroups.com, computer.s...@gmail.com
I just tried on the ipad and got a numeric keypad as expected. How did you try to apply the constraint?

CS

unread,
Jan 11, 2014, 1:18:56 AM1/11/14
to codenameone...@googlegroups.com
I re-tested again, just to make sure everything is "clean".

I used one of my forms. I added two TextField-s (using CNO Designer) to the bottom of my form (which uses BoxLayout Y), by clicking on the "Text Field" inside Core Components.
Then I clicked first of the two created text fields and changed the Constraint in "Properties" to Numeric and then the same on the second text field, but with the difference that I selected Decimal as the constraint. Everything else was left unchanged.
Then I saved the "*.res" file and executed "Send iOS Debug build" (btw. currently I am using your debug certificate for testing purposes).

After I installed the app on iOS. I went to that form and if I click on first text field, a numeric pad is opened and if I click on second text field a normal keyboard is opened.

Maybe some other user, which is currently working on some iOS stuff, can confirm or deny my findings (just to make sure).

Shai Almog

unread,
Jan 11, 2014, 4:02:19 AM1/11/14
to codenameone...@googlegroups.com, computer.s...@gmail.com

I used the designer too and just to make sure I just tested it on an iPhone 4 OS 6.x.


Reply all
Reply to author
Forward
0 new messages