开发者社区> 问答> 正文

listview如何添加多个

在一个activity布局文件中如何添加多个listview控件,或是如何通过fragment实现在一个activity中添加多个listview

展开
收起
爵霸 2016-06-12 13:42:15 1855 0
1 条回答
写回答
取消 提交回答
  • 在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>
    2019-07-17 19:33:48
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载