这两个 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/