缺少TextAppearances.Micro风格 [英] Missing TextAppearances.Micro style

查看:287
本文介绍了缺少TextAppearances.Micro风格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Android开发者设计风格印刷术,有4 TextAppearance S(微型,小型,中型,大型)。

According to Android Developer Design Style for Typography, there are 4 TextAppearances (Micro, Small, Medium, Large).

但没有predefined样式微:

But there is no predefined style for Micro:

?android:attr/textAppearanceMicro
android:style/TextAppearance.Micro

他们没有在Android的源被发现。我缺少什么?

None of them can be found in sources of Android. What am I missing?

推荐答案

好问题!研究一点点后,我没有找到TextAppearance.Micro。

Good question! After researching a little bit, I didn't find any results for "TextAppearance.Micro".

在另一方面,我发现<一个href=\"https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/styles.xml\"相对=nofollow>官方Android源相关的样式资源 TextAppearance 秒。

On the other hand, I found the official Android source for style resource related to TextAppearances.

<style name="TextAppearance.Small">
    <item name="android:textSize">14sp</item>
    <item name="android:textColor">?textColorSecondary</item>
</style>

<style name="TextAppearance.Medium">
    <item name="android:textSize">18sp</item>
</style>

<style name="TextAppearance.Large">
    <item name="android:textSize">22sp</item>
</style>

正如你所看到的,所有的人都只会影响文字的大小(除 TextAppearance.Small ,这也影响文本颜色)。所以,我可以肯定地说,该网站显示的文字大小,因为只有一个准则。在另一方面,你可以随时添加自定义样式,支持 TextAppearance.Micro !只是里面的 styles.xml 插入此。

As you can see, all of them only affect the text size (except TextAppearance.Small, which also affect the text color). So, I can safely say that the site displays the text sizes as a guideline only. On the other hand, you can always add a custom style to support TextAppearance.Micro! Just insert this inside styles.xml.

<style name="TextAppearance.Micro" parent="@android:style/TextAppearance.Small">
    <item name="android:textSize">12sp</item>
</style>

和使用它像:

<TextView
    ...
    android:textAppearance="@style/TextAppearance.Micro" />


在一个有点相关的说明,当我搜索textAppearanceMicro,我发现在GitHub上3个项目。他们都加入了一些自定义的属性,其中一个是 textAppearanceMicro 。此外,所有的人都使用 ActionBarSherlock 。我不知道是否有之间的连接 textAppearanceMicro ActionBarSherlock ,但我没有找到该属性是在code任何地方使用。


On a bit related note, when I searched "textAppearanceMicro", I found 3 projects on GitHub. All of them adding some custom attributes, which one of them is textAppearanceMicro. Also, all of them are using ActionBarSherlock. I don't know whether there is a connection between textAppearanceMicro and ActionBarSherlock, but I didn't find that attribute was used anywhere in the code.

这篇关于缺少TextAppearances.Micro风格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆