How to add tab bar controllers to the root view of the split view controller application

前端 未结 3 1593
礼貌的吻别
礼貌的吻别 2021-01-06 16:42

\"enter

I am very new to the iPad UISplitViewController.

I need

3条回答
  •  再見小時候
    2021-01-06 17:08

    in your app delegate add tabbar controller then add your view controllers to tabbar controller and set the window rootview controller to tabbar controller.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
     self.tabbar=[[UITabBarController alloc] init];
    
       self.vc1 = [[vc1 alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
       // do the same to other VCs
        self.tabbar.viewControllers=[NSArray arrayWithObjects:vc1,vc2,vc3,vc4, nil];
    
    
    self.window.rootViewController = self.tabbar;
    
    [self.window makeKeyAndVisible];
    return YES;
    

    }

    i hope it helps :-)

提交回复
热议问题