我是否需要实现导航控制器才能添加其他控制器的视图?
当用户点击按钮时,我将显示一个全新的视图(管理目的)。
AdminViewController *adminView = [[AdminViewController alloc]initWithNibName:@"AdminView" bundle:nil];
[self.view addSubview:adminView.view];
[adminView release];
在我按下的视图中,我有一个带有关闭按钮的 IBAction。基本上,当我点击关闭按钮时,我想销毁第二个视图并返回到原来的视图。
我无法使用 self.view removeFromSuperview 因为这几乎会删除窗口中的所有内容。你们认为我需要做什么?
When user taps on a button, I am displaying a whole new view (administration purposes)
AdminViewController *adminView = [[AdminViewController alloc]initWithNibName:@"AdminView" bundle:nil];
[self.view addSubview:adminView.view];
[adminView release];
In the view that I am pushing I have an IBAction with a close button. Basically, when I hit the close button, I want to destroy that second view and go back to my original one.
I can't use self.view removeFromSuperview because that will pretty much remove everything I have in the window. What do you guys think I need to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来这个设置是
按下关闭按钮时的理想选择,您可以
在任一视图控制器上执行操作以使其消失。
It sounds like this setup is an ideal candidate for
when the close button is pressed, you can do
on either view controller to make it disappear.