I have string which should look like below
<string name="text">
<![CDATA[Text in bigger font size 20.. Text in normal font size 10
]]>
</string>
Any idea or inputs whether this can be achievable? It is preferable if I use CDATA tag, but unfortunately the font tag isn't working inside the CDATA. The font through the text remains the same even if I set the size.. I will consume this string in a TextView.
Adding fonts to a TextView To set a font for the TextView , do one of the following: In the layout XML file, set the fontFamily attribute to the font file you want to access. Open the Properties window to set the font for the TextView .
Just use getText(R. string.
String. xml file contains all the strings which will be used frequently in Android project. String. xml file present in the values folder which is sub folder of res folder in project structure.In Android Studio, we have many Views such as TextView,Button,EditText,CheckBox,RadioButton etc.
<string name="text">
<font size="20">Text in bigger font size 20..</font><font size="10"> Text in normal font size 10</font>
</string>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With