Android listview not scrolling

前端 未结 7 1385
离开以前
离开以前 2020-12-21 15:21

i have a layout whose starting tag(parent tag is ) is



        
7条回答
  •  失恋的感觉
    2020-12-21 15:59

    You cannot add a ListView in a scroll View, as list view also scrolls and there would be a synchonization problem between listview scroll and scroll view scroll. You can make a CustomList View and add this method into it.

    @Override public boolean onInterceptTouchEvent(MotionEvent ev)
    {
        /*
         * Prevent parent controls from stealing our events once we've gotten a touch down
         */
        if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
            ViewParent p = getParent();
            if (p != null) {
                p.requestDisallowInterceptTouchEvent(true);
            }
        }
        return false;
    }
    

提交回复
热议问题