我有一個包含以下項目的活動: 活動頂部顯示的動作欄(一個imageview,一個視圖和兩個imagebutton)而對於屏幕的其餘部分,我有一個ListView。這全部放置在main.xml佈局中。該列表將始終有6行不再存在,並且操作欄在此活動中不可見。向上和向下滾動ListView會丟失列表中的頂部和底部項目 - 附帶屏幕截圖
當上下滾動時,listview從某些行中丟失了文本/圖像。
之前滾動(我不得不隱藏標誌雖然,抱歉)
Before scrolling http://img706.imageshack.us/img706/37/32572081.png
滾動向下和向上後(注意DGL查找文本消失)
after first scrolling http://img638.imageshack.us/img638/7334/4scrollup.png
滾動後再次向上(注意DGL查找仍然不存在,危險類別圖文消失得
scrolling again and again http://img839.imageshack.us/img839/4970/5scrolldownagain.png
如果我保持上下滾動,並行可能會再次出現,並可能會消失,以及。
,這裏是我的main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFF"
android:orientation="vertical" >
<include layout="@layout/action_bar" />
<ImageView
android:id="@+id/splashscreen"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center" >
</ImageView>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000"
android:textColor="#000" >
</ListView>
</LinearLayout>
有快捷的幫助!我對Android非常陌生
問題是你實現你的'ViewHolder'和您的適配器實現的說。發佈該代碼。 – Rajkiran 2012-03-30 12:29:38
http://stackoverflow.com/questions/4777272/android-listview-with-different-layout-for-each-row – MKJParekh 2012-03-30 12:40:18
謝謝Rajkiran,我將首先嚐試@Frankenstein解決方案,因爲它聽起來與我的問題非常相關面臨,因爲我有自定義項目/行內的列表視圖。謝謝科學怪人,我明天會更新你 – 2012-04-01 20:06:22