从模态视图推送视图
我试图从我的模态视图中推动一些视图。我正在尝试做与其他观点相同的事情。但问题是,我认为,模态视图没有导航控制器。
CadastroViewController *vaiCadastro = [[[CadastroViewController alloc] initWithNibName:
NSStringFromClass([CadastroViewController class]) bundle:nil] autorelease];
[self.navigationController presentModalViewController:vaiCadastro animated:YES];
我可以做什么来将另一个视图推入我的模态视图中?
谢谢!
im trying to push some view from my modal view. Im trying doing the same things that i do on other views. But the problem is, i think, thats the modalview doesnt have a navigation controller.
CadastroViewController *vaiCadastro = [[[CadastroViewController alloc] initWithNibName:
NSStringFromClass([CadastroViewController class]) bundle:nil] autorelease];
[self.navigationController presentModalViewController:vaiCadastro animated:YES];
What can i do to push another view inside of my modal view?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
@Lucas Veiga 在这种情况下你必须创建导航控制器的对象...并且你将得到导航栏,原因是 modalview 没有导航控制器
祝你好运!
@Lucas Veiga you have to make the object of navigation controller in this case...and you will get the navigationBar the reason is modalview doesnt have a navigation controller
Good luck!
“但问题是,我认为模态视图没有导航控制器。”
是的,模态视图控制器没有导航控制器,除非您创建一个导航控制器并将其添加到模态视图控制器。然后就可以了。
顺便说一句,您可能想知道模态视图控制器及其父控制器是否可以共享导航控制器,答案是否定的,您需要创建单独的导航控制器用于推送和弹出不同的控制器层次结构。
"But the problem is, i think, thats the modalview doesnt have a navigation controller."
Yes, the modal view controller doesn't have a nav controller UNLESS you create one and add it to the modal view controller. Then it'll work.
Btw, you may wonder whether the modal view controller and its parent controller can share a nav controller or not, well, the answer is no, you need to create separate nav controllers for pushing-and-popping at different controller hierarchies.