android 统一按钮样式,Android 更改按钮样式 Button Styles(示例代码)

在Android中,使用Support Library v7可以轻松地应用预定义的按钮样式,如Widget.AppCompat.Button和Widget.AppCompat.Button.Colored。若要全局更改所有UI控件的颜色,包括按钮,可以通过修改colorAccent属性在主题中设置。对于特定按钮的样式调整,可以创建新的样式,继承预设风格,并自定义背景和字体颜色。最后,通过设置android:theme应用该样式到按钮,或者在布局的styles.xml中设定默认按钮主题。
摘要由CSDN通过智能技术生成

extends:http://stackoverflow.com/questions/26346727/android-material-design-button-styles

I will add my answer since I don‘t use any of the other answers provided.

With the Support Library v7, all the styles are actually already defined and ready to use, for the standard buttons, all of these styles are available:

style="@style/Widget.AppCompat.Button"

style="@style/Widget.AppCompat.Button.Colored"

style="@style/Widget.AppCompat.Button.Borderless"

style="@style/Widget.AppCompat.Button.Borderless.Colored"

Widget.AppCompat.Button: 344f5690e5240c33a25f5bdcd382f126.png

Widget.AppCompat.Button.Colored: 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值