package com.slfinance.app.slb.common.ui.view; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.ScrollView; /** * Created by xionglh on 2016/03/19. */ public class MyInnerScrollView extends ScrollView { public MyInnerScrollView(Context context, AttributeSet attrs) { super(context, attrs); } private int mLastY = 0; @Override public boolean onTouchEvent(MotionEvent ev) { int y = (int) ev.getY(); View childView = getChildAt(0); switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: mLastY = y; break; case MotionEvent.ACTION_MOVE: if (mLastY-y> 0&&childView != null && childView.getMeasuredHeight() <= getScrollY() + getHeight()) { return false; } break; } return super.onTouchEvent(ev); } }
解决VerticalViewPager中嵌套ScrollView滑动问题
猜你喜欢
转载自blog.csdn.net/x605940745/article/details/50931247
今日推荐
周排行