所以,本质上tableView是一个scrollView,
scrollView的禁止滑动属性lz你应该知道吧
tableViewuserInteractionEnabled = NO;public class MyScrollview extends ScrollView {
private int downX;
private int downY;
private int mTouchSlop;
public MyScrollview(Context context) {
super(context);
mTouchSlop = ViewConfigurationget(context)getScaledTouchSlop();
}
public MyScrollview(Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = ViewConfigurationget(context)getScaledTouchSlop();
}
public MyScrollview(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mTouchSlop = ViewConfigurationget(context)getScaledTouchSlop();
}
@Override
public boolean onInterceptTouchEvent(MotionEvent e) {
int action = egetAction();
switch (action) {
case MotionEventACTION_DOWN:
downX = (int) egetRawX();
downY = (int) egetRawY();
break;
case MotionEventACTION_MOVE:
int moveY = (int) egetRawY();
if (Mathabs(moveY - downY) > mTouchSlop) {
return true;
}
}
return superonInterceptTouchEvent(e);
}
}重写scrollview 例如MyScrollView extends ListView 然后重写里面的方法 @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { superonScrollChanged(l, t, oldl, oldt); } 这里获取到的第1个参数我想就是你需要的 即 scrollview 滑动结束的坐标点
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)