小编典典

默认 "large", "medium" and "small"文本视图的 dpi 值 android

all

文档(或任何人)是否讨论了默认的 dpi 值

  • Large TextView { android:textAppearance="?android:attr/textAppearanceLarge"}
  • Medium TextView { android:textAppearance="?android:attr/textAppearanceMedium"}
  • Small TextView { android:textAppearance="?android:attr/textAppearanceSmall"}

SDK 中的小部件?

"large", "medium" and "small"和常规文本视图

换句话说,我们可以在不使用android:textAppearance属性的情况下复制这些文本视图的外观吗?


阅读 71

收藏
2022-08-27

共1个答案

小编典典

见android sdk目录。

\platforms\android-X\data\res\values\themes.xml

    <item name="textAppearanceLarge">@android:style/TextAppearance.Large</item>
    <item name="textAppearanceMedium">@android:style/TextAppearance.Medium</item>
    <item name="textAppearanceSmall">@android:style/TextAppearance.Small</item>

\platforms\android-X\data\res\values\styles.xml

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

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

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

TextAppearance.Large表示样式是从样式继承的TextAppearance,如果您想查看样式的完整定义,还必须对其进行跟踪。

链接:http:
//developer.android.com/design/style/typography.html

2022-08-27