CodenameOne
CodenameOne copied to clipboard
Constraint(TextField.NUMERIC|TextField.NON_PREDICTIVE) NOT WORK ON IOS
please provide a solutions to this contraint that doesn't work in TextField and TextArea
tfTokenDigit1.setConstraint(TextField.NUMERIC|TextField.NON_PREDICTIVE);
Does it work for tfTokenDigit1.setConstraint(TextField.NUMERIC); ?
yes but NO_PREDICTIVE does'nt work
Does NUMERIC without NON_PREDICTIVE include any predictive aspects?
When you say "not work" please elaborate. Is it crashing?
Is it showing text input instead of numeric input?
Is it showing predictive content?
is showing predictive content
Looking at the code here https://github.com/codenameone/CodenameOne/blob/master/Ports/iOSPort/nativeSources/CodenameOne_GLViewController.m#L367
It seems that prediction is turned off just before the numeric constraint for the single line edit. This should work out of the box for simple text fields. I don't see this for multi-line fields though. Check that:
- You're using
TextFieldand notTextArea - You didn't invoke
setSingleLineTextArea(true) - You don't have a custom third party keyboard or similar configuration that might ignore our settings
Assuming all of the above please include a self contained sample and screenshot to verify the prediction. Also include iOS versions tested.