如何在主题中全局更改android按钮文本颜色 [英] How to change android button text color globally in theme

本文介绍了如何在主题中全局更改android按钮文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改我所有按钮的文本颜色?

How can I change all my buttons text color?

我知道我可以像这样设置背景颜色:

I know I can set the background color like follows :

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    ...
    <item name="colorButtonNormal">@color/buttonColor</item>
</style>

如何为文本"按钮执行此操作?

How can I do this for the button Text?

推荐答案

 <style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
   <item name="android:textColor">#yourcolor</item>
    <item name="android:buttonStyle">@style/ButtonColor</item>
    <item name="colorButtonNormal">@color/buttonColor</item>
</style>



<style name="ButtonColor" parent="@android:style/Widget.Button">
   <item name="android:textColor">@color/yourcolor</item>
</style> 

android:textColor 这应该可以帮助您全局更改文本颜色.希望对您有所帮助.谢谢

android:textColor This should help you change the text color globally. I hope this is helpful ThankYou

这篇关于如何在主题中全局更改android按钮文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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