Sorry for the long and understandable title, but UIScrollView has raised so many questions that itβs hard for me to reach those that can help in different situations.
I have nested scrollviews in my iPad app. So far so good, everything has its ups and downs, but its pretty sleek and responsive. My outter scroll view is an uploaded page containing full-screen or larger scrolling views of content. Outroll scrollview is horizontal and internal. Like the photo gallery. I found that when I scale and scroll the inner scroll, there is a noticeable delay in detecting slow and long swipe gestures ONLY when the scroll is scanned down to the bottom of the content and the bounce is off.
Another thing is that the internal scrollview bouncing property is YES / NO pseudo-randomly. So this is the code in the constructor that sets the internal scrolls that act up:
if (UIInterfaceOrientationIsPortrait(forOrientation)) { self.minimumZoomScale = 1.0; self.maximumZoomScale = 1.0; self.bounces = NO; self.alwaysBounceVertical = NO; self.scrollEnabled = NO; }else if (UIInterfaceOrientationIsLandscape(forOrientation)){ self.minimumZoomScale = 1.333333f; self.maximumZoomScale = 1.333333f; self.bounces = YES; self.alwaysBounceVertical = YES; self.scrollEnabled = YES; } self.scrollsToTop = NO; self.showsVerticalScrollIndicator = YES; self.showsHorizontalScrollIndicator = NO; self.directionalLockEnabled = YES; self.delegate = self; self.pagingEnabled = NO; self.canCancelContentTouches = NO; self.delaysContentTouches = YES;
When the iPad is rotated, the bounce will come and be suitable for viewing the scroll, and will also have a rebound.
This is mistake? Or is it just me that I ruined it?
in advance for your time and interest!
UPDATE: I have nested two scrollviews, which are actually subclasses of UIScrollView. I do this because I need to override hitTest and other methods. I also tried the Better solution described here http://openradar.appspot.com/8045239 and did not get good results.
source share