禁用崩溃ExpandableListView的 [英] Disable collapsing of ExpandableListView

查看:82
本文介绍了禁用崩溃ExpandableListView的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ExpandableListView 的默认行为是可折叠组的头被点击时。是否有可能以prevent这种情况的发生?

The default behavior of ExpandableListView is to collapse a group when its header is clicked. Is it possible to prevent this from happening?

我已经试过:

  • 设置 OnTouchListener 的名单上。这干扰了滚动。
  • 在列表上设置一个 OnGroupClickListener (在的onCreate())。这适用于所有点击的的第一个。
  • Setting OnTouchListener on the list. This interferes with scrolling.
  • Setting an OnGroupClickListener on the list (in onCreate()). This works for all clicks after the first.

有没有其他人做到了这一点?为什么会在 OnGroupClickListener 错过了第一次点击?

Has anyone else accomplished this? Why might the OnGroupClickListener miss the first click?

在此先感谢您的建议。

推荐答案

看来问题不得不与那里是在组头既是一个聚焦元素和 OnGroupClickListener 设置。卸下听者解决我的问题。

It seems the problem had to do with there being both a focusable element in the group header and an OnGroupClickListener set. Removing the listener solved my problem.

这篇关于禁用崩溃ExpandableListView的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆