将子视图延迟加载到非分页UIScrollView中 [英] Lazy loading of subViews into a non-paging UIScrollView

查看:115
本文介绍了将子视图延迟加载到非分页UIScrollView中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现类似幻灯片的UIScrollView,它将填充目录页面的缩略图。选择缩略图图像将使主UIScrollView移动到所选页面。目录可能包含100到200页,我只想在需要时懒得加载它们。

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.

我在启用了分页的UIScrollView中完成了这个,但是没有在非分页场景中看到了解决这个问题的最佳方法。在任何时候UIScrollView中都会显示6个缩略图(滚动视图时为+ 1)。我想在滚动视图时出列并重新使用缩略图的UIView,就像我在主UIScrollView(这是一个分页滚动视图)中所做的那样。

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).

谢谢 -

Jk

推荐答案

查看来自apple的scrollview套件示例代码。平铺的示例可能很容易改变用途。

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

http://developer.apple.com/library/ios/#samplecode/ScrollViewSuite/

这篇关于将子视图延迟加载到非分页UIScrollView中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆