如何使用样式材料设计在警报对话框片段按钮? [英] How to style buttons in Alert Dialog Fragment using Material Design?

查看:1554
本文介绍了如何使用样式材料设计在警报对话框片段按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变一个警告对话框的默认按钮样式。

I'd like to change the default button styling on an alert dialog.

标准警报对话框片段(Android中L)是这样的:

The standard Alert Dialog Fragment (in Android L) looks like this:

我想向右按钮的样式作为一个正常的按钮而不是一个无国界的按钮。谷歌本身似乎使用各种对话框,如以下模式:

I'd like the right button to be styled as a normal button instead of a borderless button. Google itself seems to use this pattern in various dialogs, such as:

有谁知道这是可能的,无需从头开始重建整个对话?

Does anyone know if this is possible, without recreating the whole dialog from scratch?

推荐答案

您可以在属性主题风格的按钮:的android:buttonBarPositiveButtonStyle Android的:buttonBarNegativeButtonStyle 的android:buttonBarNeutralButtonStyle

You can style the button in the theme with attributes: android:buttonBarPositiveButtonStyle, android:buttonBarNegativeButtonStyle, and android:buttonBarNeutralButtonStyle.

这篇关于如何使用样式材料设计在警报对话框片段按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆