当我的应用程序启动时,我有 6 个 View Controller 。它就像一个图片库。例如,当用户按下第三个 View 上的按钮时,他/她应该进入选项卡栏中的第三个 View 。
我使用此代码启动选项卡栏 Controller 顶部的 View Controller :
- (void)viewDidAppear:(BOOL)animated {
static BOOL first = YES;
if (first) {
UIViewController *popup = [[Home1ViewController alloc] initWithNibName:@"Home1ViewController" bundle:nil];
[self presentViewController:popup animated:NO completion:nil];
first = NO;
}
}
通过使用这段代码关闭这个新 View ,我只是来到特定的 View ,而不是我的标签栏页面...
-(IBAction)dismissView {
TabBarPage3 *screen = [[ TabBarPage3 alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:screen animated:YES];
}
请帮帮我! 谢谢
最佳答案
这是在 TabBar 上改变 View 的代码
[((UITabBarController *)(self.parentViewController))setSelectedIndex:index];
关于ios - 转到特定的标签栏 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14327566/