开发者

Convert iPad NavController To Split Screen Controller

开发者 https://www.devze.com 2023-03-25 06:15 出处:网络
So I made my iPhone app universal, it created a new mainWindow xib file for the iPad, and it has a UINavigation Controller which works fine.I want to use a UISplit Screen Controller and put the rootvi

So I made my iPhone app universal, it created a new mainWindow xib file for the iPad, and it has a UINavigation Controller which works fine. I want to use a UISplit Screen Controller and put the rootview as the bigger view. I tried doing this but it didn't work and I just ended up with rootview with no navbar and no split screen.

In appDidFinisLaunching, I have:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//    if (NSClassFromString(@"UISplitViewController") != nil && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 
//    {
//        self.window.rootViewController = self.splitViewController;
//    }
//    else
//    {
//        self.window.rootViewController = self.navigationController;
//    }
    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
    return YES;
}

My "RootViewController" is a UIView Subclass with a UITableView Object.

And this is what my IB currentl开发者_运维问答y looks like:

Convert iPad NavController To Split Screen Controller


Apple' UISplitScreenController container object is always the root. This contains a master viewController and a detail viewController. The Detail is effectively the child and is the larger of the two.

You cannot do what you are trying to do - at least not with Apple's splitViewController.

From Ios5 you will be able to write your own containers though.

Alternatively, you could also look at MGSplitViewController: https://github.com/mattgemmell/MGSplitViewController

0

精彩评论

暂无评论...
验证码 换一张
取 消