什么是Android的默认字体特征​​? [英] What are the default font characteristics in Android ?

查看:145
本文介绍了什么是Android的默认字体特征​​?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,字体属性可以在字体类中找到,但我找不到写作的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.

推荐答案

您可以查看这里的小部件的默认样式:<一href="https://raw.github.com/android/platform_frameworks_base/master/core/res/res/values/styles.xml">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>

这些颜色在<定义href="https://github.com/android/platform_frameworks_base/tree/master/core/res/res/color">/res/color/,检查<一href="https://raw.github.com/android/platform_frameworks_base/master/core/res/res/color/secondary_text_dark.xml">/res/color/secondary_text_dark.xml

书签的<一个href="https://github.com/android/platform_frameworks_base/tree/master/core/res/res/values">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.

这篇关于什么是Android的默认字体特征​​?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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