我有以下列方式一个主题:alertDialogTheme不工作(程序兼容性V23)
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primaryDark</item>
<item name="colorAccent">@color/accent</item>
<item name="alertDialogTheme">@style/AppTheme.Dialog</item>
</style>
<style name="AppTheme.Dialog" parent="Theme.AppCompat.Dialog.Alert">
<item name="colorAccent">@color/accent</item>
</style>
但是,当我创建我的应用程序里面AlertDialogs,他们没有主题的。其他组件如ActionBar被正确着色。我错过了什么吗?
我使用AppCompat版本com.android.support:appcompat-v7:23.1.1
,我的设备安装了Android 4.4.4。
http://stackoverflow.com/questions/26455919/material-design-not-styling-alert-dialogs/29810469#29810469 –
谢谢,我的问题是做'android:alertDialogTheme' vs只是'alertDialogTheme' ...经过4年的android开发,我仍然不明白为什么这会产生变化...... – ElliotM