Leonard Febrianto
Leonard Febrianto

Reputation: 984

Set / Unset Underline TextView

I have managed to make underline in my textview. Here is the code :

txtOrder1.setPaintFlags(txtOrder1.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

Now i want to remove that underline. Is it possible ?

Upvotes: 0

Views: 195

Answers (2)

pRaNaY
pRaNaY

Reputation: 25312

You need to try like below code:

txtOrder1.setPaintFlags(txtOrder1.getPaintFlags() & (~ Paint.UNDERLINE_TEXT_FLAG));

Upvotes: 3

Brendon
Brendon

Reputation: 1368

For remove the Underline use like this

txtOrder1.setPaintFlags(txtOrder1.getPaintFlags() | ~ Paint.UNDERLINE_TEXT_FLAG);

or

txtOrder1.setPaintFlags(0);

Upvotes: 1

Related Questions