原文出自 http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0102/2254.html
public class CustomViewPager extends ViewPager { PRivate boolean isPagingEnabled = true; public CustomViewPager(Context context) { super(context); } public CustomViewPager(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onTouchEvent(MotionEvent event) { return this.isPagingEnabled && super.onTouchEvent(event); } @Override public boolean onInterceptTouchEvent(MotionEvent event) { return this.isPagingEnabled && super.onInterceptTouchEvent(event); } public void setPagingEnabled(boolean b) { this.isPagingEnabled = b; }}新闻热点
疑难解答