Kyros Nox
Kyros Nox

Reputation: 183

How to remove the underline in a TextField in CODENAME ONE?

I'm trying to remove the underline that shows in a TextField in codenameone.

'''

TextField username = new TextField("", "", 20, TextArea.USERNAME);

'''

image example

Upvotes: 1

Views: 29

Answers (1)

Shai Almog
Shai Almog

Reputation: 52770

What you're seeing there is the platform look and feel. So on iOS theme this will look different. Technically this is the border so you can just override it e.g. in CSS with:

border: none;

But this is the WRONG SOLUTION!

The right solution would be:

username.setUIID("MyTextField");

Which will let you explicitly specify in the theme how the component will look and give you 100% full control over the look of the component.

Upvotes: 1

Related Questions