Android list view inside a scroll view

后端 未结 30 2064
一向
一向 2020-11-21 13:43

I have an android layout which has a scrollView with a number of elements with in it. At the bottom of the scrollView I have a listView

30条回答
  •  南方客
    南方客 (楼主)
    2020-11-21 14:02

    listView.setOnTouchListener(new View.OnTouchListener() {
    
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        scrollView.requestDisallowInterceptTouchEvent(true);
    
        int action = event.getActionMasked();
    
        switch (action) {
            case MotionEvent.ACTION_UP:
                scrollView.requestDisallowInterceptTouchEvent(false);
                break;
        }
    
        return false;
    }
    });
    

提交回复
热议问题