默认值&“大"&“中&"的dpi值和“小型"文字检视Android [英] dpi value of default "large", "medium" and "small" text views android

查看:111
本文介绍了默认值&“大"&“中&"的dpi值和“小型"文字检视Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Does the documentation ( or anyone) talks about the dpi values of the default

  • 大TextView {android:textAppearance="?android:attr/textAppearanceLarge"}
  • 中等TextView {android:textAppearance="?android:attr/textAppearanceMedium"}
  • 小型TextView {android:textAppearance="?android:attr/textAppearanceSmall"}
  • Large TextView {android:textAppearance="?android:attr/textAppearanceLarge"}
  • Medium TextView {android:textAppearance="?android:attr/textAppearanceMedium"}
  • Small TextView { android:textAppearance="?android:attr/textAppearanceSmall"}

SDK中的小工具吗?

widgets in the SDK ?

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

To put it in another way, can we replicate the appearance of these text views without using the android:textAppearance attribute?

推荐答案

请参阅android sdk目录.

See in the android sdk directory.

\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样式继承的,如果要查看样式的完整定义,也必须对其进行跟踪.

TextAppearance.Large means style is inheriting from TextAppearance style, you have to trace it also if you want to see full definition of a style.

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

这篇关于默认值&amp;“大"&amp;“中&amp;"的dpi值和“小型"文字检视Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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