簡體   English   中英

更新android sdk r12之后的android自定義警報對話框錯誤

[英]Android Custom Alert Dialog Error after updating android sdk r12

將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。

android:style/AlertDialog不是公共樣式,您不應使用它。 請參考此主題如何更改AlertDialog的主題

最后,我找到了答案。 我知道這不是正確的方法,但目前可以使用。

I managed to fix it by replacing the platform-tools_r06 with platform-
tools_r05 in android sdk folder

您可以從此處下載platform-tools-r05。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM