How do you change text/font settings in an Android TextView
? For example, how do you make the text bold?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- 放在input的text下文本一直出现一个/(即使还没输入任何值)是什么情况
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
Assuming you are a new starter on Android Studio, Simply you can get it done in design view XML by using
Set the attribute
You can use this for font
create a Class Name TypefaceTextView and extend the TextView
private static Map mTypefaces;
paste the font in the fonts folder created in the asset folder
Place the lines in the parent layout in the xml
Define a new style with the format you want in the style.xml file in the values folder
Then apply this style to the TextView by writing the following code with the properties of the TextView
Simply you can do the following:
Set the attribute in
XML
Programatically the method is:
Hope this helps you thank you.
In XML
You can only use specific fonts
sans
,serif
&monospace
via xml, Java code can use custom fontsProgrammatically (Java code)