我試圖做到這一點,所以我有一個標籤欄在我的屏幕底部,它始終在那裏。我也想要它,所以如果我在其中一個選項卡中「點擊」某個菜單,它可以讓您選擇返回,從而導航控制器和標籤欄控制器。與tabbar控制器一起使用navigationcontoller
我還是不太瞭解iOS,所以我發現的答案讓我感到困惑。
這樣的回答:Having a UITabBar AND a UINavigationController in an app?
那麼,如何實現這一點?我猜我在我的應用程序委託中更改了此方法,
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIViewController *viewController1, *viewController2;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
viewController1 = [[CFSDFirstViewController alloc] initWithNibName:@"CFSDFirstViewController_iPhone" bundle:nil];
viewController2 = [[CFSDSecondViewController alloc] initWithNibName:@"CFSDSecondViewController_iPhone" bundle:nil];
} else {
viewController1 = [[CFSDFirstViewController alloc] initWithNibName:@"CFSDFirstViewController_iPad" bundle:nil];
viewController2 = [[CFSDSecondViewController alloc] initWithNibName:@"CFSDSecondViewController_iPad" bundle:nil];
}
self.tabBarController = [[UITabBarController alloc] init];
[self.tabBarController setDelegate:self];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
感謝您的協助!