0

示例触摸 + 上移时发生的情况

当 touch + move up 时,webview 弹跳(底部的白色区域显示)(关闭按钮不受影响,因为它不在 webview 中)

在 web 视图中打开嵌入式 Vimeo 播放器时,我在禁用反弹/滚动时遇到问题。播放器嵌入在 iframe 中 - 这使其成为 iframe 中的 iframe。

我已经成功禁用了 webview 和第一个 iframe 的滚动和反弹,我使用这个本机代码

for (id subview in webView.subviews)
    if ([[subview class] isSubclassOfClass: [UIScrollView class]]) {

        ((UIScrollView *)subview).bounces = NO;

        [[subview scrollView] setScrollEnabled: NO];


    }

对于第一个 webview 和 iframe,我使用 javascript

addLoadEvent(function () {
  document.ontouchmove = function(e){ e.preventDefault(); }

问题这适用于 webview 和第一个 iframe,但不适用于嵌入式 vimeo iframe。

4

1 回答 1

0

With that include this might work.

webview.setHorizontalScrollBarEnabled(false);
webview.setVerticalScrollBarEnabled(false);

Also as the video is inside a frame and the frame inside Webview then the video frame is a subview of frame and not webview. You should try to search for class in frame and disable scrol. :D

于 2014-02-19T14:21:56.413 回答