![]() ![]() Programmatically at run time in java file. in the xml layout file we can assign the string resourceĪs following android example app code demonstrate us how can we bold, italic or underline TextView text stylish_text key's valueĬontain html tags those make part of text bold, italic and underlined. In the following example code, we declare a string key value pair name stylish_text and its value. strings.xml resource file exist under res/values folder. Output show the stylish text on android app. The string resource file allow us to declare a string resource which value contain html tags. This is very interesting that we can render a TextView's part of text as bold, italic or underlined by using string resource file. ![]() android:textStyle="normal|italic" value display textĪs italic, android:textStyle="bold" value display text only bold and android:textStyle="normal" value define TextView text so if we want to render TextView text as bold and italic then we need to set theĪndroid:textStyle attribute value as android:textStyle="blod|italic". Separated them using keyboard pipe | symbol. The android:textStyle attribute allow us to set the text style to normal, bold or italic. Italic, normal and even underlined by declarative syntax. this first android app demonstrate us how can we render TextView text bold, we also can bold TextView text syntacticallyīy using string ressource file. we can render a TextView to display text as bold or italicīoth programmatically by java file and syntactically by xml layout file. TextView widget display text on android app. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |