I am trying to add UiActivityStatus and Show a "Please Wait image' while presentModalViewController loads which takes 16 - 20 seconds...
我正在尝试添加UiActivityStatus并在presentModalViewController加载时显示“请等待图像”,这需要16 - 20秒......
The image shows up but then screen turns white right away and sits there for the 16-20 seconds. I am guessing the call to presentModalViewController returns right away.
图像显示但屏幕立即变为白色并在那里停留16-20秒。我猜是对presentModalViewController的调用立即返回。
Is there anyway around showing status when a call to presentModalViewController takes a long time.
无论如何,当调用presentModalViewController需要很长时间时,显示状态。
PS: it takes a long time before i am loading some 100 pictures in that view
PS:我需要很长时间才能在该视图中加载100张图片
thanks!!
1 个解决方案
#1
I assume you are loading the images in your viewControllers loadView. You can preload the view by sending it a view message [myViewController view]
which will cause the load to happen. The view is displayed when you add it to the subview. so your code would be:
我假设您正在viewControllers loadView中加载图像。您可以通过向视图发送视图消息[myViewController视图]来预加载视图,这将导致负载发生。将视图添加到子视图时,将显示该视图。所以你的代码将是:
- Display activity indicator
- send view message
- push modal view controller
- hide activity indicator
显示活动指标
发送查看消息
推模态视图控制器
隐藏活动指标
I would advise you to modify your design though. A pause of 16-20 seconds with no user interaction is not good. Why not have the modal view active as the images come in. You could load each image that is visible first and whist they are loading you could display a spinner in their place.
我会建议你修改你的设计。没有用户交互的暂停16-20秒并不好。为什么不在图像进入时激活模态视图。您可以加载每个首先可见的图像,并且他们正在加载您可以在其位置显示微调器。
#1
I assume you are loading the images in your viewControllers loadView. You can preload the view by sending it a view message [myViewController view]
which will cause the load to happen. The view is displayed when you add it to the subview. so your code would be:
我假设您正在viewControllers loadView中加载图像。您可以通过向视图发送视图消息[myViewController视图]来预加载视图,这将导致负载发生。将视图添加到子视图时,将显示该视图。所以你的代码将是:
- Display activity indicator
- send view message
- push modal view controller
- hide activity indicator
显示活动指标
发送查看消息
推模态视图控制器
隐藏活动指标
I would advise you to modify your design though. A pause of 16-20 seconds with no user interaction is not good. Why not have the modal view active as the images come in. You could load each image that is visible first and whist they are loading you could display a spinner in their place.
我会建议你修改你的设计。没有用户交互的暂停16-20秒并不好。为什么不在图像进入时激活模态视图。您可以加载每个首先可见的图像,并且他们正在加载您可以在其位置显示微调器。