Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android:fontFamily requires api level 16, but docs say level 15 is ok?

Tags:

android

How do I set the font family on API level 15? The docs say API 15 does have the fontFamily attribute. I hoped the docs would say

"This is depcrecated in API level 15. For API level 15 and lower, see [........]"

but they don't. How do I set the 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

like image 389
Rock Lee Avatar asked Aug 22 '14 23:08

Rock Lee


1 Answers

You are wrong what you are seeing is the class API not the attribute API level:

You can look here and said:

public static final int fontFamily
Added in API level 16

Font families are actually create since android 4.1 not in 4.0.3-4.0.4

like image 58
Rod_Algonquin Avatar answered Nov 14 '22 20:11

Rod_Algonquin