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