Android set the system's own font

1, set in the layout file

//set font

android:typeface="normal" //sans  serif  monospace


Settings and styles

android:textStyle="normal" //bold bold italic italic


android:fontFamily=""


2.java code settings

textVie.setTypeface(Typeface.DEFAULT); //Set the font, which is equivalent to setting the android:typeface attribute in xml


textVie.setTypeface(Typeface.DEFAULT,Typeface.BOLD_ITALIC); //Set the font and style

Equivalent to setting the android:typeface attribute and android:textStyle attribute in xml

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325624724&siteId=291194637