I want to draw the underline below my TextView. I have searched a few content but couldn’t find out anything fruitful.
Can anyone please help me out here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are three ways of underling the text in TextView.
SpannableString
setPaintFlags(); of TextView
Html.fromHtml();
Let me explain you all approaches :
1st Approach
For underling the text in TextView you have to use SpannableString
2nd Approach
You can make use of setPaintFlags method of TextView to underline the text of TextView.
For eg.
You can refer constants of Paint class if you want to strike thru the text.
3rd Approach
Make use of
Html.fromHtml(htmlString);OR