Is there any way to change the font for a EditText in Android? I want it to match the font's I set for all my textViews.
相关问题
- 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不能创建表
- 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
- Android OverlayItem.setMarker(): Change the marker
First Method
use this code in your java class
Second Method
Create a new java class and it as u want
Use it in your Xml file
Add this code in your java file Which type you want you can add like NORMAL, ITALIC, BOLD, BOLD_ITALIC.
edittext.setTypeface(null, Typeface.ITALIC);
Create a fonts folder on assets folder and put your .ttf font file, then into onCreate() function write:
As like as for TextView.
Edit: Above is the XML
Solution1:: Just call these method by passing parent view as argument.
Solution2:: you can subclass the TextView class with your custom font and use it instead of textview.
In your Activity or Fragment , get the main layout