当我尝试向下滚动WebView
滚动触发器SwipeRefreshLayout
而不是WebView
本身的页面时。如何将区域限制在我的活动之上?
我试着写这样的东西但是无法完成
mySwipeRefreshLayout.onTouchEvent(new MotionEvent() {
public boolean onTouchEvent(MotionEvent event) {
final int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN: {
final MotionEvent eventCopy = MotionEvent.obtain(event);
final float eventY = eventCopy.getY();
// Handle only top %20
if (eventY < (Percentage / 5)) {
int mCurrPercentage = 20;
// ......
} else {
// ......
}
}
break;
});
}