本文介绍了UiablitViewController中的UITabbarController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ipad开发的新手。我正在开发类似于以下应用程序的ipad应用程序:

I am new to ipad development. I am developing an ipad application similar to the following apps:

...

在这两个应用程序中,结构看起来像uispabviewcontroller集成在uisplitviewcontroller中。但我听说uisplitviewcontroller不能是rootviewcontroller。然后这些应用程序如何设计怎么做这样的结构???

In both these apps structure looks like uitabbarcontroller integrated inside uisplitviewcontroller. But i ve heard that uisplitviewcontroller cannot be a rootviewcontroller. Then how these apps designed??? How to do a structure like that???

推荐答案

你说uisplitviewcontroller不能是rootviewcontroller你是对的。因此,它必须作为子视图添加如下:

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;}

查看此

这篇关于UiablitViewController中的UITabbarController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 12:02