ios4 中 webview 的 javascript (iscroll4) 滚动解决方案推翻/禁用本机手势识别
在我的 iPad 应用程序中,我有一个 UIScrollView(水平滑块 - 类似于图像轮播),其中包含多个 UIWebView - 每个视图都占据整个屏幕。每个 Web 视图的顶部都有一个头栏,并且在必要时可以垂直滚动内容,这些内容应该滚动到栏后面。这是在 html 和 css 中完成的,头栏的位置:固定。
在iOS5中可以正常工作,但在iOS4中却失败了。这是一个已知问题,针对此问题有多种 JavaScript 解决方案,例如来自网站 doctyper 或iScroll4 或触摸滚动(基于 iScroll)。
这些解决方案在垂直滚动方面效果很好。我现在的问题是,只要我在垂直可滚动 div 容器内开始滑动手势(几乎占据整个屏幕 - 除了每侧的几个像素),我就无法再水平滑动(从 UIWebView 到 UIWebView)。 JavaScript 解决方案似乎阻止了 UIScrollView 水平滑动的手势识别。
我什至不确定是否可以在 Objective-C 端或 javascript 或 html 端找到解决方案。任何帮助表示赞赏。即使这只是正确方向的暗示。 谢谢。
In my iPad app I have a UIScrollView (a horizontal slider - similar to an image carousel) which contains several UIWebViews - each of which takes the whole screen. Each webview has a head-bar on top and vertically scrollable content that should scroll behind the bar if necessary. This is done in html and css with position:fixed for the head-bar.
It works fine in iOS5 but fails in iOS4. This is a known issue and there are several javascript solutions for this problem, e.g. from website doctyper or iScroll4 or touch-scroll (which is based on iScroll).
These solutions work nicely in regards to the vertical scrolling. My problem now is that I cannot swipe horizontally (from UIWebView to UIWebView) anymore as long as I start the swipe gesture inside the vertically scrollable div-container (which takes almost the whole screen - except for a few pixels on each side). The javascript solutions seem to prevent the gesture recognition of a horizontal swipe from UIScrollView.
I am not even sure if the solution is to be found on the objective-c side or on the javascript or html side. Any help is appreciated. Even if it is just a hint in the right direction.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在此处找到了问题的答案。在 iscroll-lite.js 中,您必须取消第 60 行的注释。在第 225 行的正下方,
您必须添加以下行
现在我可以使用 iscroll 垂直滚动和 iOS 水平滚动的辅助功能。
I found the answer to my question here. In
iscroll-lite.js
you have to uncomment line 60. And in line 225 right underyou have to add the line
Now I can use the scrolling aid of iscroll vertically and the iOS-scrolling horizontally.