expandablelistview可展开的列表组件怎么实现多选

2025-05-15 03:14:42
推荐回答(2个)
回答(1):

ExpandableListView额外支持的xml属性

编写布局文件
version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/elv1">


建立数组,用于列表展示

创建私有方法,用于各级列表项的显示

扩展BaseExpandableListAdapter来实现ExpandableListAdapter
关键是实现getGroupView(),getChildView()两方法

完整代码及部分说明

效果图

回答(2):

18、江南逢李龟年 杜甫