Android Webview SwipeRefreshLayout不允许向下滚动

时间:2018-06-13 13:36:40

标签: android webview swiperefreshlayout

当我尝试向下滚动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; 
            });
        }

0 个答案:

没有答案