问题标签 [expandablelistview]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
446 浏览

android - 如何在 Android 上的 ExpandableListView 中从子视图导航到它的组视图?

我的 ExpandableListView 中的每个子项都构建了一个上下文菜单。在我的 OnCreateContextMenuListener() 中,我需要访问一些显示与子组关联的数据的 TextView。ExpandableListView.getPackedPositionGroup() 告诉我哪个组是孩子的父母,但我一直无法弄清楚如何使用它来获取 TextView 所在的组 View 的句柄。我没有看到什么 API?

还是有更好的方法来获取与孩子的父组关联的视图的句柄?

0 投票
1 回答
2790 浏览

android - Android ExpandableListView 中的不同值

我在使用 ExpandableListView 时遇到问题。我想要的是每个组都来自“bond”列,这是非唯一的,但我希望这些组是唯一的(即“bond”的每个值应该只有一个组)。组中的每个值在应显示的其他列中都有数据。问题是,我似乎可以将 SQL DISTINCT 运算符与一列一起使用(然后 getChildrenCursor() 抛出 IllegalStateException),或者不使用 DISTINCT 运算符并复制每个组。

任何人都可以建议解决这个问题吗?

这是我的桌子的样子 - 债券是我想要独一无二的:

_id | 姓名 | 债券 | 红外
1 | 名称 1 | 债券 1 | 红外 1
2 | 名称 2 | 债券 1 | 红外 2
3 | 名称 3 | 债券2 | 红外 3
4 | 名称 4 | 债券 3 | 红外线 4

抱歉,如果这不是特别清楚,但感谢您的帮助!

0 投票
1 回答
1246 浏览

android - 使用 CursorTreeAdapter 的 ExpandableListView 的子标头

如何在ChildView不影响我的基础数据和ChildView. 下面是我的ExpandableListView适配器的骨架实现:

私有类 EAdapter 扩展 CursorTreeAdapter {

任何帮助/指针将是最有帮助的。

0 投票
3 回答
1740 浏览

android - ExpandableListView 和 CheckedTextView 的奇怪行为

我有一个带有 CursorTreeAdapter 和 CheckedTextView 的 ExpandableListActivity 显示。它在单击时工作正常(我必须手动切换 CheckedTextView,但那是因为这是一个 ExpandableListView)但是当适配器在光标上调用 requery 时,检查的项目不是正确的(与以前一样)。

您对问题所在有任何线索吗?

0 投票
1 回答
812 浏览

android - Android ExpandableListView 不起作用(黑屏/空屏)

我尝试使用自己的 ExpandableListAdapter 构建 ExpandableListView 但 ExpandableListView 在我的活动中不可见:-(

您可以在下面找到我的源代码。

谢谢你的帮助 :-)

问候,康吉

这里是来自活动的代码:

代码 MyColoredExpandableListAdapter:

代码 MyExpandableListAdapter:

}

代码扩展列表项:

}

0 投票
1 回答
546 浏览

android - 为什么 expandablelistview 不能与上下文菜单一起使用?

我的应用程序曾经使用标准的 ListView 和 registerForContextMenu(getListView()) 并且一切正常。

我需要更改我的应用程序以适应嵌套列表,因此我将 ListView 替换为 ExpandableListView。我将 Activity 更改为 ExpandableListActivity。我还将我的适配器更改为树适配器并实现了一个自定义视图类来填充列表(基于 FrameLayout 视图)。

突然我的上下文菜单停止工作,我不知道为什么。我不能长时间点击我的任何列表项,我完全不知道从哪里开始寻找。

0 投票
2 回答
1909 浏览

android - android expandableListView - 在运行时将项目添加到特定组

我遇到了一个问题,我有一个 expandableListView 有 5 个组

如果我想向第二组添加一些项目,并在运行时更新 expandableListView,

有人可以教我怎么做吗?

0 投票
1 回答
2736 浏览

android - Is it possible to use an expandablelistview as a dropdownview for a spinner?

I have a 2d array of strings. I would like to use a spinner to allow users to select values from the 2nd lvl of the array but I would like to display the selection options in a expandablelistview using the values of the 1st lvl of the array as category headers.

Is this possible, can someone point me in the right direction of how this should be implemented ?

0 投票
1 回答
3288 浏览

android - 动态调整 ExpandableListView 中组标题的高度

我有一个 ExpandableListView (ELV),其中包含具有 LinearLayout 的组。我已将组的高度设置为某个值(在本例中为 38dip,相当于两行文本)。如果组标题很长并且需要超过 2 行,则它不会在 ELV 项目中正确显示 - 视图的某些部分会滚动。另一方面,如果我在 LinearLayout 中将 android:layout_height 更改为“wrap_content”,则组总是显示所有行。但是行宽是可变的,即短标题仅显示 1 行,长标题显示 2、3 或 4 行。那看起来很难看。我想将高度实现为 max("38dip", "wrap_content")。有没有办法做到这一点?

即使以编程方式,如果我将 android:layout_height 设置为“wrap_content”,我似乎也没有得到组的实际高度。那里有什么建议吗?

0 投票
1 回答
640 浏览

android - Android ExpandableListView 变量范围

我对 ExpandableListView 有疑问:在我的应用程序中,我使用 ExpandableListView 并用我的适配器 "class MyExpandableListAdapter extends BaseExpandableListAdapter". In 方法填充它

这段代码运行良好,但对我不利,因为每次我创建一个新的 SearchView 和 MyUpdate 实例。我将"SearchView search"and"MyUpdates myUp"作为全局变量,但这会产生一些问题:一段时间后,布局不会响应触摸事件,或者更好的是它会响应下一个触摸事件。所以我带着这里发布的原始代码回来了,但这对我没有好处。有什么建议吗?谢谢