什么是Android的默认字体特征​​?特征、字体、Android

由网友(恋之夏)分享简介:我知道,字体属性可以在字体类中找到,但我找不到写作的Andr​​oid的默认特征。我的意思是,如果我拿的TextView 键,简单地做的setText(BLABLA)就可以了,什么都会,我得到?其中规模PX?其中字体?等等。I know that fonts properties can be found in th...

我知道,字体属性可以在字体类中找到,但我找不到写作的Andr​​oid的默认特征。我的意思是,如果我拿的TextView 键,简单地做的setText(BLABLA)就可以了,什么都会,我得到?其中规模PX?其中字体?等等。

I know that fonts properties can be found in the TypeFace class but I can't find the default characteristics of the writing in Android. I mean, if I take a TextView and simply do setText("Blabla") on it, what will I get? Which size in px? Which font? etc.

推荐答案

您可以查看这里的小部件的默认样式:android/res/values/styles.xml

You can check the default style of the widgets here: android/res/values/styles.xml

然后,找TextView的到达

Then, looking for Textview you reach

  <style name="Widget.TextView">    
     <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>    
 </style>

和研究一点点之后,你发现这个样子是在同一个styles.xml文件中定义的

and after researching a little bit, you find out that this appearance is defined in the same styles.xml file

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

其中

<item name="textColorSecondary">@android:color/secondary_text_dark</item>

这些颜色在/res/color/,检查/res/color/secondary_text_dark.xml

书签的android/res/values文件夹是必须的!

Bookmarking the android/res/values folder is a must!

更新:我的老链路断开,请在Github Android的核心资源文件夹 。由于kreker的链接

Update: my old links are broken, check Android core resources folder on Github. Thanks to kreker for the link.

阅读全文

相关推荐

最新文章