Not really. A text field overflows when the text is too long and the center behavior is very inconsistent/challenging. AS text area is slightly more consistent here.
For both we don't support the editing in the center mode. On Friday, October 9, 2020 at 3:45:19 PM UTC+3 [email protected] wrote: > That works > > Seems like it would be same code to center TextField as TextArea, > > Odd. > > Regards > > > On Friday, October 9, 2020 at 12:00:40 AM UTC-4, Shai Almog wrote: > >> We don't support centering a text field at this time. Only a text area >> (multiline) and even then not when editing. So when you move to editing >> mode it will jump to the left/right respectively. >> >> Center text field has a bit of a nuanced behavior and it's hard to >> replicate it when going back and forth between native editing and >> lightweight. >> >> On Thursday, October 8, 2020 at 7:20:43 PM UTC+3 [email protected] >> wrote: >> >>> If you are experiencing an issue please mention the full platform your >>> issue applies to: >>> IDE: NetBeans/Eclipse/IDEA Netbeans 12.2 >>> Desktop OS Windows 10 Pro >>> Simulator latest >>> Device simulator IOS, Android >>> >>> Please suggest how to center align a textField with params as below. >>> Always justifies to RIGHT. LEFT works correctly >>> >>> Form hi = new Form("Center Text in TextField", >>> BoxLayout.y()); >>> TextField txt = new TextField("55565"); >>> txt.setEditable(true); >>> txt.getAllStyles().setAlignment(TextField.CENTER); >>> txt.setSingleLineTextArea(true); >>> txt.setConstraint(TextField.DECIMAL); >>> hi.add(txt); >>> hi.show(); >>> >>> Regards >>> >> -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/83622641-618c-43e0-800d-da65d4f24944n%40googlegroups.com.
