的WebView在画廊停止滚动/触摸事件 [英] WebView in Gallery stopping scroll/touch events

查看:232
本文介绍了的WebView在画廊停止滚动/触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用与WebViews Android的库功能从远程站点加载缩略图。我使用的WebView,这样它会处理缓存的图片给我。我有它工作正常与一个小问题与处理触摸事件和滚动画廊。

I am using android's gallery feature with WebViews to load thumbnails from a remote site. I'm using WebView so that it will handle caching the images for me. I have it working fine with one little issue relating to handling of touch events and scrolling the gallery.

如果你碰巧尝试和滚动画廊开始用手指上的WebView它不会滚动的顶部。 web视图消耗触摸事件。

If you happen to try and scroll the gallery starting with your finger on top of a WebView it won't scroll. The WebView is consuming the touch event.

我如何去得到它忽略这些,使他们到达画廊?

How do I go about getting it to ignore these so they get to the Gallery?

编辑:现在它也停止从得到的onItemClick事件的画廊。 D'哦!

And now it's also stopping the Gallery from getting the onItemClick events. D'Oh!

推荐答案

试试这个:

    mWebView.setOnTouchListener(new OnTouchListener(){

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            gallery.onTouchEvent(event);
            return true;
        }

    });

这篇关于的WebView在画廊停止滚动/触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆