【发布时间】:2019-03-20 15:52:53
【问题描述】:
最近我从支持库切换到 com.google.android.material:material:1.0.0
但现在我有一个问题,在这个页面中有一个注释https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md
注意:使用 Material Components 主题可以启用自定义视图充气器,它将默认组件替换为对应的 Material 组件。目前,这只会将 Button XML 组件替换为 MaterialButton。
以及我正在使用的主题
Theme.MaterialComponents.Light.NoActionBar
完全按照它在该注释中所说的那样,它将 AlertDialog 按钮替换为 MaterialButtons,但问题是默认情况下 MaterialButtons 是彩色背景,现在按钮看起来像这样:
我怎样才能让它们再次无边框和无背景?
PS 我正在使用警报生成器来创建警报对话框:
android.app.AlertDialog.Builder
【问题讨论】:
-
如果你想要 AppCompat 主题内容和一些新的 Material UI 样式,你可以使用 Bridge 主题,它可以解决你的问题,参考我的这个答案:stackoverflow.com/a/52401497/10271334
标签: android material-design android-alertdialog android-styles material-components-android