Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I would like to edit a numeric decimal value like 21.7 and enable the user to close the numeric keyboard (iOS 13.3.1, iPhone Xr) when done.
I'm using a numeric text field (
TextField
with constraint
TextArea.DECIMAL
). I've NOT set the option
putClientProperty("iosHideToolbar", Boolean.TURE)
for the TextField. However, there is no keyboard Done option, so the user cannot close the keyboard after entering the value.
I've gone through the documentation (
https://www.codenameone.com/manual/components.html
) and as I understood it, using
tf.putClientProperty("iosHideToolbar", Boolean.TRUE);
would hide the toolbar, so since I'm NOT setting the property, I assume the toolbar and the Done button should be available.
Any advice on how to get the Done button (or other ways to getting rid of the numeric keyboard)?
–
I would like to edit a numeric decimal value like 21.7 and enable the
user to close the numeric keyboard (iOS 13.3.1, iPhone Xr) when done.
I'm using a numeric text field (
TextField
with constraint
TextArea.DECIMAL
). I've NOT set the option
putClientProperty("iosHideToolbar", Boolean.TURE)
for the TextField.
However, there is no keyboard Done option, so the user cannot close
the keyboard after entering the value.
Are you sure?
I tried the following code on iOS 13 (iPhone X):
Form hi = new Form("Example", BoxLayout.y());
hi.add("Enter a decimal value:");
TextField textField = new TextField();
textField.setConstraint(TextArea.DECIMAL);
hi.add(textField);
hi.add(new Button("Submit"));
hi.show();
Result:
As you can see, this sample code produces the "Done" button on iOS. So, if your app doesn't show it, maybe the cause of the issue is elsewhere.
I just noticed that there is no Done button shown for a multi-line
TextField with normal text
I tried:
Form hi = new Form("Example", BoxLayout.y());
hi.add("Enter a multiline text:");
TextArea textField = new TextArea("", 3, 80);
textField.setConstraint(TextArea.ANY);
hi.add(textField);
hi.add(new Button("Submit"));
hi.show();
Result:
Also in this case, there is the "Done" button.
Currently, as far as I know, the "Done" button is not shown in the iOS virtual keyboard toolbar if it's already included in the keyboard itself, for example in the case of a generic TextField without a "next" TextField. I mean like in the following screenshot (note that the blue key "fine" is the Italian equivalent of "Done"):
So, I don't know how to help you. Try to update your question (or try to open a new one) adding a self-enclosed test case that reproduces your issue.
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.