当 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。