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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章