Keeping a number of Scroll in Sync
Keeping a number of Scroll in Sync
- Subject: Keeping a number of Scroll in Sync
- From: Dave <email@hidden>
- Date: Fri, 04 Oct 2013 14:27:44 +0100
Hi,
I've been asked to implement a View that contains three horizontal Scroll Views. Each scroll view contains a number of image views with a fixed height but variable width. There is a gap between each image in the a scroll view and a gap between each of the three Scroll views. The idea is that when one scroll view is scrolled by the user, the other two scroll with it but at a different rate. Think of the effect as looking like a wall made of different sized bricks:
Top Scroll View: AAAAA BBB CCCCCC DDDD EEEEE
Middle Scroll View: FFFFFFFF GG HHHH IIIII JJJJJ LLLLL
Bottom Scroll View: MMM NNNNN OOO PPPP QQQQ RRR
Where AAAA, BBBB etc. are images in the Scroll Views.
When the User scrolls the top view, the middle and bottom views should scroll too by a different amount.
I've got this working but I'm not that happy with it, since it stutters and also I'm getting feedback because one Scroll View update another, which in turn updates the original scroll view. Basically, in the scrollViewDidScroll, I pass the contentOffset to the other two Scroll Views. I think that if I added some state info and did checking I could get it to work as required using this method, but I'm not sure that it is the best way to do it?
All the Best
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden