How to get a non scrollable ListView?

前端 未结 6 1943
挽巷
挽巷 2020-11-28 12:49

I should want a non scrollable ListView, and show the entire ListView. It\'s because my entire screen is a ScrollView, and I dispatch widgets with a RelativeLayout, so I don

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 13:42

    The correct answer is here.

    Just assign this listener to your ListView:

        listView.setOnTouchListener(new OnTouchListener() {
    
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_MOVE) {
                return true; // Indicates that this has been handled by you and will not be forwarded further.
            }
            return false;
        }
    });
    

提交回复
热议问题