【发布时间】:2016-06-11 11:53:55
【问题描述】:
我有一个主题如下:
<!-- 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。
【问题讨论】:
-
谢谢,我的问题是
android:alertDialogTheme而不是alertDialogTheme.... 经过 4 年的 android 开发,我仍然不明白为什么这会有所作为...
标签: android android-alertdialog android-appcompat android-theme