--ADVERTISEMENT--

TextView is used to display text in android application. In website we can see different types of font and text styles like that we can also add different style inside textview (in android text). In this tutorial you will learn to make multiple styles in android TextView text with different method like bold text, italic, text color of specific word, etc.

There are many ways to make multiple styles inside android TextView and in this example I have made multiple style with three different ways using HTML tags and Html.fromHtml().

Related:
How to Make Android TextView Text Selectable
Android Text Links Using Linkify
Android Auto Complete using AutoCompleteTextView and MultiAutoCompleteTextView

Android Example: How to Make Multiple Styles Inside Android TextView


Following is the example code to make text bold, italic, color of specific word, small text, etc in android textview text.


XML Layout File


Following is the content of XML layout file.
res/layout/ multiple_style_inside_android_textview.xml


Java Activity File


Following is the content of java activity file.
src/ MultipleStyleInsideAndroidTextView.java

Strings.xml File


res/values/strings.xml


Android Example: How to Make Multiple Styles Inside Android TextView

Now, run your Make Multiple Styles Inside Android TextView application and see how it looks. You can see some bold text, italic text, small text, color in some word, etc.

Post a Comment

Powered by Blogger.