这是我的自定义列表视图的一行。正如你所看到的,有三个imageViews。我应该如何重写如何通过getview为多个imageView设置图像资源
public View getView(int position, View convertView, ViewGroup parent)
,这样,我可以设置imageView.setImageResource,不管我有多少imageviews在我的名单。任何帮助深表感谢。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/LinearLayout01"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="10px" />
<ImageView
android:id="@+id/image1"
android:layout_toRightOf= "@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10px" />
<ImageView
android:id="@+id/image2"
android:layout_toRightOf= "@+id/image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10px" />
</RelativeLayout>
</LinearLayout>
我想你也有被持有者级,现在你有设置该持有人类别的图像资源。 – 2012-07-27 10:49:31
看到这个[示例](http://android-example-code.blogspot.in/p/dynamic-custoized-list-view-in-android.html) – MAC 2012-07-27 10:50:08