0

我目前正在开发一个带有四个视图的 iPad 应用程序,可以使用分段控件进行查看。其中一个视图是我使用 UIScrollView 创建的图片库。问题是所有图像都在 viewDidLoad 方法中加载到视图中,因此当我在分段控件中按下“图像”时,大约需要一秒钟,直到控件突出显示“图像”并显示非常不方便的视图。I'd like to achieve that when "images" is chosen the segmented control switches immediately and the view is being loaded and then the images should be loaded and put into the scroll view one after another.

怎么做?

4

1 回答 1

0

您可以从 viewDidLoad 发布代码吗?

您是从远程位置加载图像吗?

如果您要远程加载图像,您可能需要查看: https ://github.com/nicklockwood/AsyncImageView

它是一个异步图像查看器,在加载图像时还提供图像占位符。

此外,您可能希望在 viewDidAppear 中加载图像,这样视图就会出现,然后它开始加载图像......

于 2012-08-09T11:17:50.683 回答