如何处理 ExpandableListView 子级的一行中不同视图的单击事件
我知道如何通过订阅(setOnClickChildListener)ExpandableListView(或覆盖ExpandableListActivity回调方法:onChildClick)来处理事件。两者让我知道了 groupPosition、childPosition 和行布局视图(我的子级自定义布局)的详细信息。 但我想知道单击了哪个特定视图(例如我的自定义行的哪个文本视图)。
我尝试重写 mSimpleCursorTreeAdapter 的 getView 方法并将我的文本视图订阅到 onClick 侦听器。但这样我就无法知道点击的子行的groupPosition和childPosition。如果我以这种方式处理视图的 onClick,该事件将被消耗,并且 OnClickChildListener 和回调方法 onChildClick 永远不会被调度。
我想我说错了什么。我希望有人告诉我一个方法。
谢谢。
I know how to handle the events by subscribing (setOnClickChildListener) of the ExpandableListView (or overriding the ExpandableListActivity callback method: onChildClick). The two let me know the details groupPosition, childPosition and the view of the row layout (my custom layout for the childs).
But I want to know what particular view has been clicked (for example which textview of my custom row).
I tried it overriding the getView method of the mSimpleCursorTreeAdapter and subscribing my textviews to the onClick listener. But in this way I can't know the groupPosition and the childPosition of the child row clicked. If I handle the onClick of the views in this way, the event is consumed and OnClickChildListener and the callback method onChildClick never will be dispatched.
I guess I am saying something wrong. I hope someone tells me a way to do.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经找到解决办法了:
谢谢
I've found a solution:
Thanks