2015-05-29 54 views
0

我一直在尋找,但仍然無法找到方法。更改按鈕主題中的文本顏色> = Android 4.2

怎樣才能改變所有文字按鈕的顏色(不修改其他部件的android:textColor的方案

NB:不工作

<!-- Base application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <!-- Customize your theme here. --> 
    <item name="colorButtonNormal">#1bbc9b</item> 
    <!--<item name="android:textColor">#ffffff</item>--> 
    <item name="android:buttonStyle">@style/AppTheme.MyButton</item> 
    </style> 

    <style name="AppTheme.MyButton" parent="@android:style/TextAppearance"> 
    <item name="android:textColor">#ffffff</item> 
    </style> 

更新:修復了只是改變按鈕顏色, 。而不是整個按鈕樣式

+0

請檢查此鏈接,它可能對您有所幫助。 http://stackoverflow.com/questions/2410836/how-do-i-apply-a-style-to-all-buttons-of-an-android-application – Amee

+0

你好@Amee,仍然不起作用它使用的是AppCompat 7.22。 – jhtong

回答

1

這爲我工作在values/styles.xml,配置: