PresentModalViewController:如何与父级交互
显示模态 ViewController 效果很好:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView];
[self.navigationController presentModalViewController:navController animated:YES];
[navController release];
在我的模态视图中,我有一个导航按钮可以切换回主菜单。通常 a 会调用 [self.navigationController popToViewController:delegate.viewMainmenuanimate:YES];
但这在模态视图中是不可能的。我如何与“父母”互动以称呼他,他称之为“popToViewController”?
多谢!
Showing a modal ViewController works fine:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView];
[self.navigationController presentModalViewController:navController animated:YES];
[navController release];
In my modal view, I have a navigation button to switch back to the mainmenu. Normally a would call [self.navigationController popToViewController:delegate.viewMainmenu animated:YES];
but thats not possible inside the modal view. How can I interact with the "parent" to call him that he calls popToViewController
?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在模态 vc 中使用属性parentViewController并调用
[self.parentViewController解雇ModalViewControllerAnimated:是];
use property parentViewController in your modal vc and call
[self.parentViewController dismissModalViewControllerAnimated: YES];
如果您询问如何关闭模态视图控制器,您将希望模态视图本身调用:
If you are asking how to dismiss the modal view controller, you'll want the modal view itself to call: