TextView Formatting

  • Replies:5
  • Answered
Linu S.
  • Forum posts: 77

Aug 19, 2016, 11:04:41 AM via Website

How to add text format like bold, italics , strong in textView???

Reply
Ashish Tripathi
  • Forum posts: 211

Sep 23, 2016, 1:54:47 PM via Website

use typrface attribute

Linu S.

Reply
Linu S.
  • Forum posts: 77

Sep 23, 2016, 2:25:19 PM via Website

Thanks..

Reply
Sena Ardy
  • Forum posts: 2

Sep 27, 2016, 8:18:39 AM via Website

more easy if you use on XML,

android:textStyle="bold"

Reply
Dmitry
  • Forum posts: 12

Oct 1, 2016, 5:56:50 AM via Website

If you need more complex formating to do from code use SpannableString
SpannableString text = new SpannableString(textToColor);
ForegroundColorSpan colorSpan = new ForegroundColorSpan(color);
text.setSpan(colorSpan, 0, text.length(), 0);`

here text color is changed.

Linu S.Vladimir S.

Reply
Atiqur S.
  • Forum posts: 12

Oct 1, 2016, 12:09:36 PM via Website

Shortcut to your work is Ctrl + B

Linu S.

Reply