nav与tabbar混合使用,这种节目应用范围很广的,比如网易云音乐的首页节目:
既有底部的tabbar又有导航栏,而且各个导航栏界面相互独立。
这个界面实现起来也不算复杂,下面就介绍一种通用的写法:
在AppDelegate.m中:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
HomeViewController *home = [[HomeViewController alloc] init];
UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:home];
home.title = @"首页";
home.view.backgroundColor = [UIColor orangeColor];
MusicViewController *music = [[MusicViewController alloc] init];
UINav