Android Button字母大写问题

参考博客:http://blog.csdn.net/ouyang_peng
####1. 解决方案
在Button中添加android:textAllCaps="false"的定义

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAllCaps="false"/>

####2. 原因
默认的button文字样式定义为全字母大写<item name="textAllCaps">true</item>,定义位于styles_material.xml中,文件在以下目录:

/frameworks/base/core/res/res/values/styles_material.xml

具体代码:

<style name="TextAppearance.Material.Button">
    <item name="textSize">@dimen/text_size_button_material</item>
    <item name="fontFamily">@string/font_family_button_material</item>
    <item name="textAllCaps">true</item>
    <item name="textColor">?attr/textColorPrimary</item>
</style>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章