您的位置:首页 > 产品设计 > UI/UE

iPhone软件开发之UINavigationController 装载/卸载 ViewController 的注意事项

2009-07-17 21:21 525 查看
前一篇中说了用多线程搞定进度显示,后面问题就来了。

我这个 上传方式是,先显示 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
YES
to animate the transition or
NO
if you do not want the transition to be animated. You might specify
NO
if 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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: