UINavigationController 的问题

发布于 2024-08-28 06:52:53 字数 350 浏览 3 评论 0原文

我正在创建一个游戏,在其中我需要提供这种功能,能够从任何级别进入第一个屏幕,并从第一个屏幕进入任何级别(在恢复的情况下),为此我使用导航控制器。 我面临的问题是我不希望这种推送看起来是动画的,所以我写了

[self.navigationController PushViewController:level1_completeanimate:NO];

它对于提升我的第一级效果很好。但是在该级别结束后,应用程序崩溃,因为没有其他 viewController 被推送,如果我将这个动画属性设置为“YES”,那么一切都可以正常工作,但它当然会以动画方式显示...我不希望它看起来动画并且让它运行。

有人可以帮忙吗?提前致谢。

I'm creating an game in which I need to provide this facility of being able to come to the first screen from any level, and go to any level from first screen(in case of RESUME), for which I'm using a navigation controller.
The problem I'm facing is I dont want this pushing to look animated so I wrote

[self.navigationController pushViewController:level1_complete animated:NO];

It works fine for pushing my first level. But after that level is over, the application crashes as no other viewController gets pushed, and if I make this animated property to be "YES", then evrything works fine but it appears animatedly ofcourse... I dont want it to look animated and make it run.

Can anybody please help? Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

勿忘初心 2024-09-04 06:52:53

您是否从 level1_complete 推送另一个视图控制器?

如果是,那么也将其设置为动画:不,

我认为问题会得到解决......

are you pushing another view controller from level1_complete ?

if yes then make it also as animated:NO

i think problem will be resolved...

花开浅夏 2024-09-04 06:52:53

关卡完成后,您正在使用导航控制器做什么?

您应该能够执行以下操作:

//Level One Completed
//Pop level one view controller to return to the main screen
[self.navigationController popViewControllerAnimated:NO];

What are you doing with the navigation controller when the level is completed?

You should be able to do something like:

//Level One Completed
//Pop level one view controller to return to the main screen
[self.navigationController popViewControllerAnimated:NO];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文