Does anyone know how to implement the behaviour of scrollview in iOS 6 AppStore app lists? Particularly, paging of 3,5 icons (half of icon in the right side), and when the list ends – half of the icon in the left side.
Tried so far:
1. Custom gesture recognizer (looks a bit hacky + a lot of math in the code)
2. Different configurations of scrollview and its subviews (insets, frame, content size, etc.), but it’s still not working as expected
I am not 100% sure if the App Store app actually uses
UIScrollView– it used to be mainly HTML based.Regardless, you should be able to use the relatively new delegate method
scrollViewWillEndDragging:withVelocity:targetContentOffset:, introduced in iOS 5. This method is designed for you to move the scroll view to a custom position once the user lifts their finger without needing to worry about deceleration / velocity (i.e, custom paging offsets). You’ll need to make sure your scroll view is set not to page for this delegate method to be triggered.Once it is triggered (when the user lifts their finger off the screen) you can calculate the required content offset and set the passed in
targetContentOffsetproperty. The scroll view will then automatically decelerate to the appropriate content offset you supplied.