How-to-underline-textview-in-android

If you want to underline TextView in Android you can use this code:

        SpannableString contentUnderline = new SpannableString("some text here");
        contentUnderline.setSpan(new UnderlineSpan(), 0, contentUnderline.length(), 0);
        TextView TextViewCopyright = (TextView) findViewById(R.id.TextView01);
        TextViewCopyright.setText(contentUnderline);


Special thanks to Eli.

Posted in Android, Java at March 21st, 2011. 1 Comment.