我有一个由标签栏制作的 x-code 项目。在AppDelegate.m
我为每个视图创建三个按钮:
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
UIViewController *viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil] autorelease];
UIViewController *viewController2 = [[[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil] autorelease];
UIViewController *viewController3=[[[ThirdViewController alloc]initWithNibName:@"ThirdViewController" bundle:nil]autorelease];
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.viewControllers = @[viewController1, viewController2,viewController3];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
当我在第一个视图上时,我想创建一个调用另一个视图的按钮:
-(IBAction)btnPush{
[[self navigationController] pushViewController:newView animated:YES];
}
但是当新视图出现时,它会覆盖底部的标签栏。我该如何解决这个问题?