Android 将buttonStyle应用为主题不会';不起作用,但如果直接应用于按钮,则不起作用
我在看一本关于这个问题的教程。如果我直接将样式应用于按钮,它会工作,但是如果我使用Android 将buttonStyle应用为主题不会';不起作用,但如果直接应用于按钮,则不起作用,android,android-styles,Android,Android Styles,我在看一本关于这个问题的教程。如果我直接将样式应用于按钮,它会工作,但是如果我使用android:buttonStyle将样式应用于主题,它不会工作 示例-以下是应用按钮样式的样式xml: values/styles.xml @样式/按钮文本 填补家长的空缺 包装内容 #ffffff @可拉拔/红色橙色按钮 drawable/ruddy_orange_button.xml: 但是,如果我将样式直接应用于按钮,它将起作用: <Button android:layout_w
android:buttonStyle
将样式应用于主题,它不会工作
示例-以下是应用按钮样式的样式xml:
values/styles.xml
@样式/按钮文本
填补家长的空缺
包装内容
#ffffff
@可拉拔/红色橙色按钮
drawable/ruddy_orange_button.xml:
但是,如果我将样式直接应用于按钮,它将起作用:
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/ButtonText"
android:text="hello there" />
有人指出我做错了什么吗
我在安卓2.3.3上测试了这个
源已打开。请尝试以下操作:
<style name="ButtonText" parent="@android:style/Widget.Button">
我也遇到了这个问题。希望这个提示能帮助你 appcompat v21+您应该在主题中使用
buttonStyle
而不是android:buttonStyle
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/ButtonText"
android:text="hello there" />
<style name="ButtonText" parent="@android:style/Widget.Button">