Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase font size in strings.xml in android

Tags:

string

android

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.

like image 658
user3747512 Avatar asked Apr 15 '15 12:04

user3747512


People also ask

How do I change font size in XML?

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 .

How do I make a string bold in XML?

Just use getText(R. string.

What is strings XML in Android?

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.


Video Answer


1 Answers

<string name="text">
    <font size="20">Text in bigger font size 20..</font><font size="10"> Text in normal font size 10</font> 
</string>
like image 136
elin Avatar answered Sep 21 '22 09:09

elin