2011-08-03 39 views
0

更新我的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的唯一東西。

回答

0

最後我找到了答案。我知道它不是正確的方式,但它現在起作用。

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

您可以從here下載platform-tools-r05。

0

android:style/AlertDialog不是一種公共風格,你不應該使用它。請參考此線程How to change theme for AlertDialog

+0

對不起,我的錯誤,把'@'符號......但它給了我同樣的錯誤.. –

+0

給出的線程還指定使用@android:style/AlertDialog !!! –

+0

...但後來在下面的評論中,他們說使用'@android:style/Theme.Dialog'實際工作。 –