android - 如何在android中以编程方式创建多个列表

标签 android android-listview android-adapter android-xml

我需要创建多个列表,每个列表应处于折叠 View 中,如下图所示

enter image description here

用户可以一次打开多个折叠部分。 我必须创建这个,但我不确定如何才能做到这一点,任何提示或帮助将不胜感激。

最佳答案

它的名字是ExpandableListView

A view that shows items in a vertically scrolling two-level list. This differs from the ListView by allowing two levels: groups which can individually be expanded to show its children. The items come from the ExpandableListAdapter associated with this view.

关于android - 如何在android中以编程方式创建多个列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65507460/

相关文章:

android - setContentView 需要很长时间(10-15 秒)才能执行

android - 在 Android Studio 中导入模块

android - 如何从 ImageView 将图像设置为墙纸?

向上和向下滚动时 ListView 中的android-ImageView不显示图像

android - 没有连接适配器;跳过布局

android - 在 Android 中创建元素周期表

java - 抽屉导航上的动画在所有设备上都不流畅

java - 将光标数组放入 ListView 但有多列

android - 从 ListAdapter 或 SimpleCursorAdapter 填充 ListView

android - ExpandableListView 是否需要多个 viewHolder?