gpt4 book ai didi

ios - 清除 iOS 应用程序中的屏幕堆栈

转载 作者:行者123 更新时间:2023-11-28 20:27:35 26 4
gpt4 key购买 nike

我有 SplashScreen -> Sign Up -> Sign In -> MainScreen 屏幕。在 MainScreen 中,没有必要记住所有屏幕堆栈(我的意思是我可以返回到注册/登录屏幕,但我不应该有这种可能性)。如何关闭不需要的屏幕?为 iOS UI 开发时,这是一种好方法吗?

最佳答案

如果您使用的是 UINavigationController:

 //Pop back to the root view controller
[self.navigationController popToRootViewControllerAnimated:NO];

//Allocate and init the new view controller to push to
NewViewController *newVC = [[NewViewController alloc] init];

//Push the new view controller
[self.navigationController pushViewController:newVC animated:YES];

关于ios - 清除 iOS 应用程序中的屏幕堆栈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13444213/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com