ImageAndTextListAdapter是实现ListView的Adapter,里面有个技巧就是imageView.setTag(imageUrl),setTag是存储数据的,这样是为了保证在回调函数时,listview去更新自己对应item,大家仔细阅读就知道了。
最后贴出布局文件:
- <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://www.easck.com/apk/res/android"
- 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"
- /> <TextView android:id="@+id/text"
- android:layout_width="wrap_content" android:layout_height="wrap_content"/>
- </LinearLayout>
运行效果截图如下:

希望本文所述对大家的C#程序设计有所帮助。










