android - ExpandableListView 设置 subview 的最大尺寸

标签 android expandablelistview

我有一个 ExpandableListView,我想为 childView 设置最大尺寸,如果我在 childView 中有更多内容可以通过滚动获得。

问题是,如果我在 childView 中有 5 个项目,我如何才能将 childView 的最大大小设置为仅在向下滚动时才能看到 3 行以及第 4 行和第 5 行?

最佳答案

你只能让三个项目可见 specyfying getCount() 方法并将值设置为 3

在xml中 您可以将可扩展 ListView 的高度指定为仅对应三个元素的高度。

关于android - ExpandableListView 设置 subview 的最大尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8171138/

相关文章:

android - 将 expandableListView 示例变成 fragment

java - Android 只从 iso-8601 获取时间

java - 如何在 Android 用户界面中显示计时器

android - chrome 检查设备不显示端口

android - 致命异常 : NoSuchMethodError: No static method setOnApplyWindowInsetsListener

android - 适用于 Android 的单声道 - ExpandableListView

android - 我可以将 WebRTC-Native Android 演示与我的 kamilio/freeswitch 集成吗?

android - 将动态子项添加到 ExpandableListView(添加记录时)

android - 如何从 onContextItemSelected 确定项目属于哪个类

Android Studio,如何从 JSON Volley 生成 ExpandableListView?