Reputation: 6847
When trying to make text underlined:
setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
TextView
becomes non anti-aliased. If I enable anti-aliasing:
getPaint().setAntiAlias(true)
Then it becomes anti-aliased.
Is there some connection between anti-aliasing and Paint.UNDERLINE_TEXT_FLAG
?
Upvotes: 1
Views: 497
Reputation: 3455
There is no connection betwenn anti-aliasing and Paint.UNDERLINE_TEXT_FLAG
.
But the difference is that setPaintFlags(Paint.UNDERLINE_TEXT_FLAG)
will remove default existing flags & set the current flag as Paint.UNDERLINE_TEXT_FLAG
only. Try the below code to keep existing flags & add new flag
yourTextView.setPaintFlags(yourTextView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
Upvotes: 1