更新 android sdk r12 后 Android 自定义警报对话框错误
将我的 android sdk 版本更新到 r12 后,出现以下错误。
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/AlertDialog'.
这是我的 xml 文件。
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomDialogTheme" parent="@android:style/AlertDialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowAnimationStyle">@android:style/Theme.Dialog</item>
</style>
</resources>
我没有更改代码中的任何内容,我唯一做的就是升级了 Android SDK。
I got the following error after updating my android sdk revision to r12.
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/AlertDialog'.
Here is my xml file.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomDialogTheme" parent="@android:style/AlertDialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowAnimationStyle">@android:style/Theme.Dialog</item>
</style>
</resources>
I didn't change anything in the code and the only thing that I did was upgraded the Android SDK.
android:style/AlertDialog
不是公共样式,您不应该使用它。请参阅此帖子如何更改 AlertDialog 的主题android:style/AlertDialog
is not a public style and you should not use it. Please refer to this thread How to change theme for AlertDialog