我正在尝试通过设置主题的alertDialogTheme属性来更改android L警告对话框中“取消”按钮的颜色,如下所示:
<item name="android:alertDialogTheme">@style/AlertDialogStyle</item>
现在AlertDialogStyle为空:
<style name="AlertDialogStyle" parent="android:style/Theme.Material.Light.Dialog">
</style>
我知道我可以使用
android:buttonBarNegativeButtonStyle
属性更新这些按钮的颜色/样式。我遇到的问题是,从Theme.Material.Light.Dialog样式开始,我的所有对话框的宽度都缩小为(似乎是)wrap_content。我有一些自定义警报对话框,这个宽度看起来很糟糕。有没有人遇到过这个问题,如果有的话有人修好了吗?
编辑:我也尝试将父设置为
android:Theme.Material.Light.Dialog
没有运气。
答案 0 :(得分:1)
解决方案是从
下降android:Theme.Material.Light.Dialog.Alert
确定了一切。