Lazy loading of subViews into a non-paging UIScrollView?

Check out the scrollview suite sample code from apple. The tiled example can probably be repurposed very easily.

Up vote 2 down vote favorite 3 share g+ share fb share tw.

I am trying to implement a filmstrip-like UIScrollView that will be populated with thumbnails of catalog pages. Selecting a thumbnail image will cause the main UIScrollView to move to the selected page. The Catalog may contain 100 - 200 pages, and I want to load them lazily only when required.

I have done this in a UIScrollView with paging enabled, but haven't seen anything on the best way to do this in a non-paging scenario. There will be 6 thumbnails visible in the UIScrollView (+ 1 when the view is being scrolled) at any one time. I want to dequeue and reuse the thumbnail's UIView when the view is scrolled, as I am doing in the main UIScrollView (which is a paging scroll view).

Thanks - Jk iphone uiscrollview link|improve this question asked Sep 1 '10 at 21:14Alpinista8331222 78% accept rate.

Check out the scrollview suite sample code from apple. The tiled example can probably be repurposed very easily. developer.apple.com/iphone/library/sampl....

Thanks, Jerry. The thumbnail view in the Tiled example is exactly what I am doing, but the example simply loads the four thumbnail views in when the view is created. I need to load thumbnail views dynamically as needed.

I don't want the memory hit of up to 200 thumbnail views at one time in the scrollView. Jk – Alpinista Sep 1 '10 at 22:13.

I am also going to suggest you take a look at some sample code of Apple, that is, Photo Scroller. If you are a registered iOS developer, you should also take a look at the WWDC10 session about scroll views in iPhone applications. developer.apple.com/library/ios/#samplec... What you need to do is mimic the behavior of a table view (which is nothing more than a subclass of UIScrollView).

What you should mimic is the reuse of the cells. It is pretty easy to implement and will dramatically reduce the memory foot print of your application since you only load the content that is currently visible in the scroll view. I hope this helps.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions