我想在警告对话框中更改默认按钮样式。
标准的Alert Dialog Fragment(在Android L中)如下所示:
我希望右键可以设置为普通按钮,而不是无边框按钮。 Google本身似乎在各种对话框中使用此模式,例如:
有没有人知道这是否可行,而无需从头开始重新创建整个对话框?
您可以使用属性设置主题中的按钮:qazxsw poi,qazxsw poi和qazxsw poi。
好的,通过更新到(刚刚发布的)版本21来自动解决问题。现在按钮自动处于原色:-)
编辑:他们不是原色,但在Android的基本绿松石..
此解决方案用于在android:buttonBarPositiveButtonStyle
中更改具有材质效果的按钮颜色。
android:buttonBarNegativeButtonStyle
android:buttonBarNeutralButtonStyle
AppCompatDialogFragment