Android的 - 在拖动动作不希望的WebView运动 [英] Android - undesired WebView movement on drag gesture

查看:245
本文介绍了Android的 - 在拖动动作不希望的WebView运动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人能帮我这个问题:

I hope someone will help me with this issue:

我得的FrameLayout有两个主要层次。
视频层,其中该数据流被广播
而在它的上面,有一个web视图,它加载
门户(HTML5 / CSS / ...)与窗口小部件,所以它看起来像
OSD在电视上。

I've got FrameLayout with two main layers. Video layer, where the streams are broadcasted and on top of it, there is a WebView, which loads a portal (HTML5/CSS/...) with widgets, so it looks like OSD on TV.

当用户触摸屏幕,节目信息,显示节目频道图标等
再次触及,OSD消失。
用户可以在两个方向(无限循环)信道之间的滑动。
所有这些手势在WebView中进行的,所以他们不会被Android的处理。
门户网站和Android之间的通信是通过JavaScript界面​​(我的网络视图层上启用)来完成。

When user touches the screen, program info, program channel icon is shown, etc. Touches again, OSD disappear. User can swipe between channels in both directions (infinite loop). All these gestures are performed in WebView, so they're not handled by Android. Communication between portal and Android is done via Javascript interface (enabled on my web view layer).

到目前为止,一切都很好。

So far, so good.

当小部件是隐藏的,他们不actualy隐藏的,他们只是表示了我的平板电脑屏幕,因为门户面积比我的Web视图面积。我使用的高度和宽度match_parent参数。

When the widgets are hidden, they're not actualy hidden, they're just shown off my tablet screen, because portal area is larger than my web view area. I am using match_parent parameters for height and width.

实际的问题是,有时,当我通过我的手指做拖,我设法滚动Web视图(移动),然后我看到了门户区域,这里的小部件是所谓的隐藏的其余部分。

The actual problem is that sometimes when I do drag by my finger, I manage to scroll the web view (move it) and then I see rest of the portal area, where the widgets are so called hidden.

我不知道如何prevent这种情况发生。我不能在Web视图中禁用的手势,我只想有它固定在左上角没有任何动静。

I wonder how to prevent this happen. I can't disable gestures for the web view, I just want to have it fixed in top left corner without any movement.

我希望有人能够帮助我。非常感谢。马丁

I hope someone will be able to help me. Many thanks. Martin

推荐答案

好吧,整理出JS / HTML的一面。我认为这个问题的解决。

Ok, sorted out on JS/HTML side. I consider this issue as resolved.

这篇关于Android的 - 在拖动动作不希望的WebView运动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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