UISplitViewController Rotation Master Master on iPhone 6 Plus

浪子不回头ぞ 提交于 2019-12-24 02:36:04

问题


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

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'

but instead I get 'MasterView' | 'MasterView2'

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


回答1:


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


来源:https://stackoverflow.com/questions/25852800/uisplitviewcontroller-rotation-master-master-on-iphone-6-plus

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