一:初始化你的ListView之后,设置setOnTouchListener 二:判断按下行为 if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) 判断移动行为 else if(motionEvent.getAction() == MotionEvent.ACTION_MOVE) 三:设置与你冲突的那个控件不能触摸 scrollView.requestDisallowInterceptTouchEvent(true); 我的代码 myListView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { myscrollView.requestDisallowInterceptTouchEvent(true); }else if(motionEvent.getAction() == MotionEvent.ACTION_MOVE){ myscrollView.requestDisallowInterceptTouchEvent(true); } return false; } });
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交