![](/img/trans.png)
[英]Changing Background and text color of AppCompat Light DarkActionBar Theme on android
[英]Changing Button Text color in theme for >= Android 4.2
我一直在搜索,但仍然找不到方法。
如何更改所有文本按鈕的顏色(而不修改方案中其他小部件的android:textColor
?
注意:不起作用
<!-- 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>
更新:修復了僅更改按鈕顏色而不是整個按鈕樣式的問題
這對我有用。 在values/styles.xml
,配置:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorButtonNormal">#fcfc00</item>
<!-- more stuff here -->
</style>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.