編輯:我刪除了我的異常信息。在@Sam的幫助下,我能夠使用修復項目屬性,並且應用程序不再強制關閉我。雖然,從圖像textview到textview圖像重新排列布局會導致它不顯示圖像。有誰知道爲什麼?所有的代碼都可以在這裏http://www.ezzylearning.com/tutorial.aspx?tid=1763429自定義列表適配器不會顯示圖片
發現我試圖遵循本教程 http://www.ezzylearning.com/tutorial.aspx?tid=1763429我有 作爲一切工作的發佈。我採用這個更復雜的 佈局。我試圖改變一些非常簡單的東西。我從左到右移動了圖像 。
前
<ImageView android:id="@+id/imgIcon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" />
<TextView android:id="@+id/txtTitle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:textStyle="bold"
android:textSize="22dp"
android:textColor="#000000"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" />
後
<TextView android:id="@+id/txtTitle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:textStyle="bold"
android:textSize="22dp"
android:textColor="#000000"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" />
<ImageView android:id="@+id/imgIcon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" />
重新排列這樣的XML不應該導致您的應用程序崩潰,還會發生其他事情。發佈你的'getView()'方法並將你的LogCat錯誤剪切並粘貼到問題中。 (你的截圖不完整......) – Sam
我的觀點正確。它應該通過ID找到所有東西,爲什麼它會失敗?我已更新了所需的信息。 –
@Sam你是如何添加滾動的?只是格式化爲代碼? –