前一篇中说了用多线程搞定进度显示,后面问题就来了。
我这个 上传方式是,先显示 ProgressViewController 之后遍历数据结构,找到需要传的,然后进行上传
结束后,将 ProgressViewController 弹出,这样 有数据的时候,网络连接正常的情况下,没有问题,
但是,在没有网络的情况下,或者是没哟数据的情况下,那么
就会出现在很短的时间内进行 pushViewController, popViewController 的操作。
同时 这两个方法都指定了使用动画效果。
结果就乱掉了。 出现 明明push 结果导航栏没有任何显示,但是进度还存在在街面上,这下完了。
之后看了一下 官方文档,其中有说明
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
Parameters
-
viewController
-
The view controller that is pushed onto the stack. This object cannot be an instance of tab bar controller and it must not already be on the navigation stack.
animated
-
Specify
YESto animate the transition orNOif you do not want the transition to be animated. You might specifyNOif you are setting up the navigation controller at launch time.
那么这个 animated 当为NO 的时候,证明需要设置导航栏的,或者是快速的 push pop 实际上也是设置导航
栏。
如果 将 push 处 的 animated 修改为 NO 问题就解决了,不过用户体验不好。
by vhly[FR]
date: 2009/07/17 21:30
HavE a GooD day.
& nbsp;
本文探讨了在iOS应用中使用多线程处理文件上传时遇到的UI动画问题。具体表现为在网络不佳或无数据情况下,快速执行界面推入与弹出动画导致的导航栏显示异常。文章给出了通过禁用特定动画来解决该问题的方法。
2万+

被折叠的 条评论
为什么被折叠?



