ListView 可以在 ExpandableListView 里面吗? [英] can ListView be inside ExpandableListView?

查看:21
本文介绍了ListView 可以在 ExpandableListView 里面吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在 ExpandableListView 中使用 ListView,以便我可以先拥有组级别,然后再拥有子数组 (listView).我已经完成了 listview 课程,而且效果很好!但是如何在可扩展列表视图中调用每个组来显示列表视图(布局)!并得到正确的孩子!请任何人帮忙!谢谢.

解决方案

实际上你可以将一个可滚动视图(例如你的 ListView)放在另一个可滚动视图(例如你的 ExpandableListView)中,并通过以下方式使前者可滚动:

>

listView.setOnTouchListener(new OnTouchListener() {@覆盖公共布尔 onTouch(查看 v,MotionEvent 事件){//禁止可滚动父视图的 onTouchv.getParent().requestDisallowInterceptTouchEvent(true);返回假;}});

can we have ListView inside ExpandableListView so that I can have group level first and then array of child (listView). i already finish from listview classes and it works perfectly! but how to call each group in expandable list view to display list view (layout)! and get the correct child ! please can any one help ! thanks.

解决方案

Actually you can put a scrollable view (e.g. your ListView) inside another scrollable view (e.g. your ExpandableListView) and make the former scrollable in the following way:

listView.setOnTouchListener(new OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        // disallow the onTouch for your scrollable parent view 
        v.getParent().requestDisallowInterceptTouchEvent(true);
        return false;
    }
});

这篇关于ListView 可以在 ExpandableListView 里面吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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