Вы можете использовать SpannableString для стилизации строк в TextView. Это позволяет TextView предоставлять разные цвета и стили для разных областей текста. Ниже приведен пример кода для справки
SpannableString styledString
= new SpannableString("Large\n\n" // index 0 - 5
+ "Bold\n\n" // index 7 - 11
+ "Underlined\n\n" // index 13 - 23
+ "Italic\n\n" // index 25 - 31
+ "Strikethrough\n\n" // index 33 - 46
+ "Colored\n\n" // index 48 - 55
+ "Highlighted\n\n" // index 57 - 68
+ "K Superscript\n\n" // "Superscript" index 72 - 83
+ "K Subscript\n\n" // "Subscript" index 87 - 96
+ "Url\n\n" // index 98 - 101
+ "Clickable\n\n"); // index 103 - 112
// make the text twice as large
styledString.setSpan(new RelativeSizeSpan(2f), 0, 5, 0);
// make text bold
styledString.setSpan(new StyleSpan(Typeface.BOLD), 7, 11, 0);
// underline text
styledString.setSpan(new UnderlineSpan(), 13, 23, 0);
// Give the styled string to a TextView
TextView textView = new TextView(this);
textView.setText(styledString);
Проверьте это , чтобы увидеть полный код.
Надеюсь, это поможет.