I'm defining a style XML for my android app. I have some TTF files I want to use, how can I set the typeface to use those files as the font as opposed to the generic "sans", "serif" & "monospace". Thanks
相关问题
- How can I create this custom Bottom Navigation on
- Illegal to have multiple roots (start tag in epilo
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Creating XML Elements without namespace declaratio
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Get Attribute Value From Simple XML Using JQuery /
see the APIDemos Example in the Documentation.
You can only use custom fonts via Java code, not through layout XML or styles/themes -- sorry!
Yes, you can :)
step 1: Create a folder and name it 'font' and your .ttf inside it.
step 2: Go to style.xml and do the following : -
step 3: Use the style tag in the any UI object:-
I created a little tutorial about this... I hope it can be useful http://spinettaro.blogspot.it/2013/01/custom-font-for-view.html
TextViewPlus.java:
attrs.xml: (in res/values)
main.xml:
You would put "saxmono.ttf" in the assets folder.