我正在通過數據庫和listview通過數據庫從我的dailogfragment中刪除項目。我能夠從列表視圖中刪除數據庫中的項目,並且能夠從列表視圖中刪除項目並刷新列表。正在刪除的listview項目後面的黑條 - android
但問題是,我得到某種類型的黑條(已刪除項目後面的背景)刪除項目後:圖像中http://i733.photobucket.com/albums/ww331/suntuu/Capture-1.png
你能看到我的默認背景是白色的(theme.holo。光),但在刪除這個黑色背景後彈出。
當我再次執行listview片段時,它消失了。
我現在已經很久沒有這個了。
這裏是我的XML佈局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="#00000000"
android:orientation="vertical" >
<ListView
android:id="@+id/list1"
android:cacheColorHint="#00000000"
style="@style/AndroDev"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:dividerHeight="2dp"
android:paddingBottom="1dp"
android:paddingTop="1dp" />
</LinearLayout>
,這裏是我的風格/ androdev:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AndroDev" parent="@android:style/Theme.Holo.Light">
<item name="android:background">#F7F7F7</item>
</style>
</resources>
UPDATE:
從我listviee刪除樣式後,這個問題似乎不見了,但後來我堅持使用列表項背景的默認背景,我想要自定義。
那麼我怎麼能實現它。
請發表你已經嘗試過 – sunil 2012-07-19 18:23:53