Underline in Textview Android Programmatically Example

Please follow and like us:

underline in textview android

Show underline in TextView in android programmatically Example

 
Show underline in TextView in android programmatically with the simple example. We can easily draw an underline bellow TextView using SpannableString. Let’s explore Demo of put underline in TextView Android Example…

Set SpannableString content in your TextView.

     String txtUnderline=new String("Add Underline in Textivew Android Example");
        SpannableString spannableContent = new SpannableString(txtUnderline);
        spannableContent.setSpan(new UnderlineSpan(), 0, txtUnderline.length(), 0);
        myTextView.setText(spannableContent);

Hope, you like our simple solution to set underline in TextView android Example.

nirav kalola