Plus上的UISplitViewController

Plus上的UISplitViewController

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

问题描述

因此,如果你创建一个带有'MasterView'和'DetailView'设置的UISplitViewController,那么

So if you create a UISplitViewController with 'MasterView' and 'DetailView' setup like this

在iPhone 6 Plus的纵向MasterView中按下/显示MasterView2按下项目按钮,然后你旋转设备,我希望看到这个 - 'MasterView2'| 'DetailView'

in the 'MasterView' in portrait on the iPhone 6 Plus you push/show 'MasterView2' by pressing the item button and then you rotate the device I would expect to see this - 'MasterView2' | 'DetailView'

但我得到'MasterView'| 'MasterView2'

but instead I get 'MasterView' | 'MasterView2'

如何在旋转iPhone 6 Plus时进行设置我得到了预期的'MasterView2' 'DetailView'?

How should this be setup so on rotating the iPhone 6 Plus I get the expected 'MasterView2' | 'DetailView'?

推荐答案

对于这里感兴趣的人我是如何解决这个问题的,使用splitviewcontroller委托

for anyone interested here is how I solved the problem, using the splitviewcontroller delegate

- (BOOL)splitViewController:(UISplitViewController *)splitViewController
collapseSecondaryViewController:(UIViewController *)secondaryViewController
ontoPrimaryViewController:(UIViewController *)primaryViewController{
   return YES;
}

- (UIViewController *)splitViewController:(UISplitViewController *)splitViewController
separateSecondaryViewControllerFromPrimaryViewController:(UIViewController     *)primaryViewController{
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    return [storyboard instantiateViewControllerWithIdentifier:@"detailView"];
}

这篇关于iPhone 6 Plus上的UISplitViewController Rotation Master Master的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 10:01