After upgrading to Android Studio 3 and using the latest SDK and build tools, it is possible to add fonts to the folder fonts
under resources and use them directly in xml or java. I use this code in my theme in styles.xml
to apply the theme in my application
<item name="android:fontFamily">@font/iransansfont</item>
He is working on Button
, TextView
and almost everything except CheckBox
and Switch
widgets. I even tried fontFamily
on mine CheckBox
and Switch
, but it doesn't work either. How can i fix this?
source
share