ipad air 2 multitasking 替换了细节视图上的主视图
ipad air 2 multitasking replaces the master view on details view
当我在主视图上进行导航后进行多任务处理并尝试调整拆分视图的大小时,主视图会克隆到详细视图上,我不知道如何解决它。
知道我做错了什么吗?
我找到了一个应用来自 UISplitViewControllerDelegate
的方法委托的解决方案
func splitViewController(splitViewController: UISplitViewController, separateSecondaryViewControllerFromPrimaryViewController primaryViewController: UIViewController) -> UIViewController? {
let primaryNavController = primaryViewController as! UINavigationController
primaryNavController.popToRootViewControllerAnimated(false)
let detailNavigationController = storyboard!.instantiateViewControllerWithIdentifier("NavigationController") as! UINavigationController
let detailViewController = detailNavigationController.viewControllers.first as! DetailViewController
// Here update your detail view controller
return detailNavigationController
}
当我在主视图上进行导航后进行多任务处理并尝试调整拆分视图的大小时,主视图会克隆到详细视图上,我不知道如何解决它。
知道我做错了什么吗?
我找到了一个应用来自 UISplitViewControllerDelegate
func splitViewController(splitViewController: UISplitViewController, separateSecondaryViewControllerFromPrimaryViewController primaryViewController: UIViewController) -> UIViewController? {
let primaryNavController = primaryViewController as! UINavigationController
primaryNavController.popToRootViewControllerAnimated(false)
let detailNavigationController = storyboard!.instantiateViewControllerWithIdentifier("NavigationController") as! UINavigationController
let detailViewController = detailNavigationController.viewControllers.first as! DetailViewController
// Here update your detail view controller
return detailNavigationController
}