1

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.

Community
  • 1
  • 1
Lem
  • 283
  • 2
  • 11

1 Answers1

0

I found the answer to my question here. In iscroll-lite.js you have to uncomment line 60. And in line 225 right under

timestamp = e.timeStamp || Date.now(); 

you have to add the line

if (Math.sqrt(deltaY * deltaY) > 3) {
    e.preventDefault();
}

Now I can use the scrolling aid of iscroll vertically and the iOS-scrolling horizontally.

sjngm
  • 12,423
  • 14
  • 84
  • 114
Lem
  • 283
  • 2
  • 11