1:首先自定义类重写ScrollView,系统运行时将会加载自己的重写的ScrollView:
public class MyScollview extends ScrollView {
public MyScollview(Context context, AttributeSet attrs) {
super(context, attrs);
// 添加了一个手势选择器
gestureDetector=new GestureDetector(new Yscroll() );
setFadingEdgeLength(0);
}
GestureDetector gestureDetector;
View.OnTouchListener onTouchListener;
public boolean onInterceptTouchEvent(MotionEvent ev) {