Skip to content

Instantly share code, notes, and snippets.

@arthtilva
Last active October 24, 2016 05:20
Show Gist options
  • Save arthtilva/899b476fae2ecd31f8eb0cca3c69bceb to your computer and use it in GitHub Desktop.
Save arthtilva/899b476fae2ecd31f8eb0cca3c69bceb to your computer and use it in GitHub Desktop.
Underline Text
String data = "Forgot Password?";
SpannableString content = new SpannableString(data);
content.setSpan(new UnderlineSpan(), 0, data.length(), 0);
.setText(content);
//====================//
String data="Underlined Text";
textView.setPaintFlags(textView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
textView.setText(data);
//====================//
String htmlData="<u>Underlined Text</u>";
textView.setText(Html.fromHtml(htmlData));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment