//对子view实现setOnTouchListener(new ...)监听,在onTouch()方法里,进行拦截。// 调用当前子view的onInterceptTouchEvent()方法。
viewpager.setOnTouchListener(newOnTouchListener() {
@OverridepublicbooleanonTouch(View v, MotionEventevent) {
switch(event.getAction()) {
caseMotionEvent.ACTION_MOVE:
(v.getParent()).requestDisallowInterceptTouchEvent(true);
break;
caseMotionEvent.ACTION_UP:caseMotionEvent.ACTION_CANCEL:
(v.getParent()).requestDisallowInterceptTouchEvent(false);
break;
}
return false;
}
});
http://blog.csdn.net/yyg204731/article/details/51261967
网友评论