问题描述
我有两个模板视图(一个是单个视图,另一个是拆分视图控制器),每个视图都可以正常工作。所以我在单视图上放了一个按钮,然后在按钮上放置一个Push Segue,转到Split View Controller。当我按下按钮时,我发现一个崩溃,说不能从外部UI导航控制器使用Push。
I have two template Views (one is a single view and the other is a Split View Controller) each individually works fine. So I put a button on the Single View and put a Push Segue on the button to go to the Split View Controller. When I press the button I get a crash saying Push cant be used from outside UI Navigation Contoller.
好的,所以我将单个视图模板放入UI导航控制器中现在说:拆分视图控制器无法推送到导航控制器。
Ok so I put the single view template into a UI Navigation Controller and it now says: Split View Controllers cannot be pushed to a Navigation Controller.
所以...我该怎么办?
So ... how do I do this ??
谢谢!
推荐答案
而不是呈现splitviewcontroller尝试设置为rootviewcontroller。
Instead of presenting splitviewcontroller try to set as rootviewcontroller.
self.view.window.rootViewController = splitViewController;
这篇关于ios如何从单视图分割到分割视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!