问题描述
- listview如何添加多个
-
在一个activity布局文件中如何添加多个listview控件,或是如何通过fragment实现在一个activity中添加多个listview
解决方案
listView 添加多个不同的adapter
listView 添加多个不同的adapter
listView 添加多个不同的adapter
解决方案二:
xml布局中写几个不就OK了吗,或者代码中new几个,在使用layoutParams设置定位
解决方案三:
在xml文件中定义,通过ID获取。
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ListView>
<ListView
android:id="@+id/listView2"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ListView>
时间: 2024-08-03 04:30:33