UITabbarController in UiSplitViewController

给你一囗甜甜゛ 提交于 2019-12-06 08:12:24

You're right that uisplitviewcontroller cannot be a rootviewcontroller. So, it has to be added as a subview as follows:

- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)options {
UIViewController *vc1 = [[CalculatorViewController alloc] init]; 
UIViewController *vc2 = [[GraphViewController alloc] init];
UISplitViewController*svc=[[UISplitViewControlleralloc]init];
svc.viewControllers = [NSArray arrayWithObjects:vc1, vc2, nil];
[vc1 release];  [vc2 release];
[window addSubview:svc.view]; 
[window makeKeyAndVisible]; 
return YES;}

Check out this sample available at developer.apple.com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!