使用BaseAdapter 与ListView结合创建图文实现更灵活的列表

  • Post author:
  • Post category:其他


使用BaseAdapter 来创建图文实现更灵活的列表
大笑

使用

BaseAdapter


来实现我们自己定义的布局,并且可以对其内部进行操作。

使用

BaseAdapter


实现图文共现的列表步骤如下:

在主布局中

xml


文件中声明一个


ListView


,承装需要加载的内容:


<?


xml


version

=

“1.0”


encoding

=

“utf-8”


?>


<


LinearLayout


xmlns:android

=

“http://schemas.android.com/apk/res/android”


android:layout_width

=

“match_parent”


android:layout_height

=

“match_parent”


android:orientation

=

“vertical”


>


<


ListView


android:id

=

“@+id/listView5”




android:layout_width

=

“match_parent”


android:layout_height

=

“wrap_content”


>


</


ListView


>


</


LinearLayout


>

二:定义列表项模板 &#x



版权声明:本文为WannerWang原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。