【发布时间】:2017-02-20 18:04:32
【问题描述】:
Style.xml 文件(AppTheme 是我的应用程序的主题,它继承了 materiallightdarkactionbar 主题)
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:colorForeground">@color/holo_orange_light</item>
<item name="android:buttonStyle">@style/newbuttonstyle</item>
</style>
<style name="newbuttonstyle" parent="@android:style/Widget.Button">
<item name="android:backgroundTint">#acd9e6</item>
</style>
</resources>
我正在设计一个计算器,这是它的键盘......而不是单独设置所有按钮的背景色调我想使用 style.xml 一次性更改所有按钮的样式...... .我可以这样做吗?
在此我使用的是 buttonStyle,但它仍然无法正常工作
<item name="android:buttonStyle">@style/newbuttonstyle</item>
【问题讨论】:
-
你们都在说我必须在按钮本身中明确提及样式,那么这有什么用?
- @style/newbuttonstyle
标签: android