gpt4 book ai didi

android:fontFamily 需要 api 级别 16,但文档说级别 15 可以吗?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:50:28 25 4
gpt4 key购买 nike

如何在 API 级别 15 上设置字体系列?文档说 API 15 确实具有 fontFamily 属性。我希望文档会说

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

但他们没有。如何在不生成此警告的情况下以 XML(或编程方式)设置字体?

这是 Ubuntu 上 Android Studio 的屏幕截图。

样式.xml:

enter image description here

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

最佳答案

你错了,你看到的是 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com