Java
SpannableString contentUnderline = new SpannableString("http://www.android-codes-examples.com");
contentUnderline.setSpan(new UnderlineSpan(), 0, contentUnderline.length(), 0);
TextView mPage = (TextView) findViewById(R.id.page);
mPage.setText(contentUnderline);
Through the SpannableString we can underline the text, it can be static or dynamic text no problem, first we have to set the string to the SpannableString and then we need to setSpan, and then we need to set that variable to the TextView.
No comments:
Post a Comment