Android: fontFamily requires api level 16, but says level 15 is ok?

How to install a font family at API level 15? The docs say API 15 has a fontFamily attribute. I was hoping the docs would say

"This is not supported at API level 15. For API level 15 and below, see [........]"

but they do not. How to install a font in XML (or programmatically) without generating this warning?

This is a screenshot from Android Studio on Ubuntu.

styles.xml:

enter image description here

http://developer.android.com/reference/android/widget/TextView.html enter image description here

+5
source share
1 answer

You are mistaken in that you see the API level. class API not attribute :

You can look here and said:

 public static final int fontFamily Added in API level 16 

Font families are actually created with android 4.1 not in 4.0.3-4.0.4

+6
source

Source: https://habr.com/ru/post/1200962/


All Articles