gpt4 book ai didi

android - 如果我的目标是 api 11+,我是否需要将类型 face-manually 设置为 roboto-light 或者我可以只使用 android :fontFamily ="sans-serif-light"

转载 作者:行者123 更新时间:2023-11-29 00:26:46 24 4
gpt4 key购买 nike

这两个 fragment 给我相同的结果。我想知道这是否只是因为我的设备在 android 4.2.2 上运行,或者如果支持库正在做一些事情,这意味着 11 岁以上的用户也会在 robotolight 中看到它。

我的问题是,如果我使用下面的第一个示例,使用 api 13 的用户是否也会看到 roboto-light 字体?

android:fontFamily="sans-serif-light"

.

 Typeface tf = Typeface.createFromAsset(
c.getAssets(), "Roboto-Light.ttf");
tv.setTypeface(tf);

最佳答案

My question is, if i used the first example below, will users on api 13 for example, also see the roboto-light font?

没有。 Roboto 字体仅在 Android 4.1 及更高版本中原生可用。

您必须像第二个示例一样为低于 4.1 的版本设置字体。查找this回答 我前一段时间提供了更多信息。

关于android - 如果我的目标是 api 11+,我是否需要将类型 face-manually 设置为 roboto-light 或者我可以只使用 android :fontFamily ="sans-serif-light",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18805480/

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