Custom List Adapter Wont Display Pictures
Edit: I removed my exception information. With the Help of @Sam I was able to use fix project properties and the application no longer force closes on me. Though, rearranging the l
Solution 1:
This makes no sense!
- Try cleaning your project: Project -> Clean...
- Or use Fix Properties from Android Tools
Also your ImageView and TextView are sitting on top of each other, you might want to add android:layout_width="wrap_content"
and android:layout_weight="5"
to the TextView and android:layout_weight="1"
to the ImageView. ... :)
Solution 2:
I had similar issue, although with different components.
What worked for me, not sure why is rearranging the xml file. placing the ImageView
before the TextView
Meaning,
<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" />
Solution 3:
You should not do
row = inflater.inflate(layoutResourceId, parent, false);
but
row = inflater.inflate(layoutResourceId, null, false);
That may be be cause. I already got exceptions due that.
Post a Comment for "Custom List Adapter Wont Display Pictures"