gpt4 book ai didi

android - 在 API < 26 中使用 XML 中的字体

转载 作者:IT王子 更新时间:2023-10-28 23:27:16 27 4
gpt4 key购买 nike

https://developer.android.com/preview/features/working-with-fonts.html

Android API 26 支持这一点,但我们是否有一个支持库可以提供使用字体作为资源中的资源? [ XML 中的字体 ] 如果是,那么它支持什么 API?

我说的是 Android O SDK 功能,它允许我们按照上面的链接在 XML 中设置字体。我敢肯定,这不是 MM 的原生功能。

最佳答案

API要支持字体家族低于26,我们需要使用

<font app:fontStyle="normal" app:fontWeight="400" app:font="@font/myfont-Regular"/>

而不是

<font android:fontStyle="normal" android:fontWeight="400" android:font="@font/myfont-Regular"/>

关于android - 在 API < 26 中使用 XML 中的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44505878/

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