要使用Android style,请使用此功能。
<style name="AlertDialog">
<item name="fullDark">@android:drawable/popup_full_dark</item>
<item name="topDark">@android:drawable/popup_top_dark</item>
<item name="centerDark">@android:drawable/popup_center_dark</item>
<item name="bottomDark">@android:drawable/popup_bottom_dark</item>
<item name="fullBright">@android:drawable/popup_full_bright</item>
<item name="topBright">@android:drawable/popup_top_bright</item>
<item name="centerBright">@android:drawable/popup_center_bright</item>
<item name="bottomBright">@android:drawable/popup_bottom_bright</item>
<item name="bottomMedium">@android:drawable/popup_bottom_medium</item>
<item name="centerMedium">@android:drawable/popup_center_medium</item>
<item name="progressLayout">@android:layout/progress_dialog</item>
<item name="horizontalProgressLayout">@android:layout/alert_dialog_progress</item>
</style>
但错误是:
error: Error: No resource found that matches the given name: attr 'fullDark'.
error: Error: No resource found that matches the given name: attr 'topDark'.
error: Error: No resource found that matches the given name: attr 'centerDark'.
error: Error: No resource found that matches the given name: attr 'bottomDark'.
error: Error: No resource found that matches the given name: attr 'fullBright'.
.
.
.
我正在使用:
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
答案 0 :(得分:0)
试试这个:
<style name="AlertDialog">
<item name="android:fullDark">@android:drawable/popup_full_dark</item>
<item name="android:topDark">@android:drawable/popup_top_dark</item>
<item name="android:centerDark">@android:drawable/popup_center_dark</item>
<item name="android:bottomDark">@android:drawable/popup_bottom_dark</item>
<item name="android:fullBright">@android:drawable/popup_full_bright</item>
<item name="android:topBright">@android:drawable/popup_top_bright</item>
<item name="android:centerBright">@android:drawable/popup_center_bright</item>
<item name="android:bottomBright">@android:drawable/popup_bottom_bright</item>
<item name="android:bottomMedium">@android:drawable/popup_bottom_medium</item>
<item name="android:centerMedium">@android:drawable/popup_center_medium</item>
<item name="android:progressLayout">@android:layout/progress_dialog</item>
<item name="android:horizontalProgressLayout">@android:layout/alert_dialog_progress</item>
</style>
答案 1 :(得分:0)
似乎你缺乏attr.xml上的定义属性 &lt; attr name =“fullDark”format =“reference”/&gt;