【发布时间】:2011-04-24 16:00:53
【问题描述】:
我有一个带有 TabBarController 的基本应用程序。我有三个选项卡,它们都有 .xib 文件,每个选项卡都会加载这些文件。每个选项卡也有一个 NavigationbarController,因此它有一个顶部带有标题的导航栏。 现在我想制作一个按钮(实际上每个选项卡上都有一个,没关系),它加载另一个视图(它应该翻转,但现在也没关系)。如何编码? 我已经有了这段代码,但是每个类的窗口都有问题(我也不知道该把它放在哪个操作中。):
- (void)flipToBack {
OptionsViewController *optionsView= [[OptionsViewController alloc] initWithNibName:@"OptionsView" bundle:nil];
[self setSecondViewController:optionsView];
[optionsView release];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES];
[viewController (?).view removeFromSuperview];
[self.window addSubview:[OptionsViewController view]];
[UIView commitAnimations];
}
其中 OptionsViewController 是我的 OptionsView 的 .h 和 .m 文件。 ViewController 是我卡住的地方。我应该在那里放什么控制器?另外:我应该把它放在哪个文件中? (可能在当前视图中),我卡在这里。
我的观点如下:
-View
-TabBar
-Navigation Bar
-TabBar item
-NavigationBar Button
-View controller
-Navigation Bar
-TabBar item
-NavigationBar Button
-View controller
-Navigation Bar
-TabBar item
-NavigationBar Button
-View controller
【问题讨论】:
标签: objective-c ios uinavigationcontroller uitabbar