关闭视图,然后显示另一个视图?
我有一个 iPhone 应用程序,我想隐藏第一个视图,然后顺利显示第二个视图。这是我的代码:
[self dismissModalViewControllerAnimated:NO];
SettingsViewController *screentwothree = [[SettingsViewController alloc] initWithNibName:@"settingsView" bundle:nil];
screentwothree.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:screentwothree animated:NO];
[screentwothree release];
}
但是,它崩溃了,没有错误。
请帮忙!
Coulton
PS:使用 UINavigationView 会更容易吗?如果是这样,您可以发布一些示例代码吗?谢谢!
I have a iPhone app where I want to hide the first view, then show the second view smoothly. Here's my code:
[self dismissModalViewControllerAnimated:NO];
SettingsViewController *screentwothree = [[SettingsViewController alloc] initWithNibName:@"settingsView" bundle:nil];
screentwothree.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:screentwothree animated:NO];
[screentwothree release];
}
However, it crashes with no errors.
Please help!
Coulton
PS: Would it be easier to use a UINavigationView? If so, can you please post some example code? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用带有延迟的 PerformSelector 在关闭第一个视图后半秒显示第二个视图。
它还可以让你有动画,使过渡更平滑。
Use performSelector with delay to show the second view half a second after dissmising the first one.
It would also allow you have animations, making a smoother transition.