Harshad Harshad - 7 months ago 69
Java Question

How to draw underline below Textview in Android?

I am new to Android And I want to draw a

underline
below the TextView using
xml
or
Java
code.
Thanks in Advance

Answer

I use of setPaintFlags method of TextView to underline the text of TextView.

For eg.

mTextView.setPaintFlags(mTextView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
mTextView.setText("This text will be underlined");