如何在 API 级别 15 上设置字体系列?文档说 API 15 确实具有 fontFamily 属性。我希望文档会说
"This is depcrecated in API level 15. For API level 15 and lower, see [........]"
但他们没有。如何在不生成此警告的情况下以 XML(或编程方式)设置字体?
这是 Ubuntu 上 Android Studio 的屏幕截图。
样式.xml:
http://developer.android.com/reference/android/widget/TextView.html
最佳答案
你错了,你看到的是 class API
而不是 attribute
API 级别:
您可以 look here并说:
public static final int fontFamily
Added in API level 16
字体系列实际上是从 android 4.1 开始创建的不在 4.0.3-4.0.4
关于android:fontFamily 需要 api 级别 16,但文档说级别 15 可以吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25456932/