【问题标题】:iOS change rootViewControlleriOS 更改 rootViewController
【发布时间】:2016-03-28 03:48:54
【问题描述】:

我有 3 个 viewController,分别命名为 firstController、secondController 和 thirdController。 我的逻辑是 firstController.presentViewController(secondController),然后是 secondController.presentViewController(thirdController),然后通过 UIApplication.shareApplication().keywindow!.rootViewController = firstController 设置一个 rootViewController...

但是当我将 firstController 设置为 rootViewController 时,当使用 thirdController.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve 将 viewController 从 secondController 呈现到 thirdController 时,firstController 将在动画期间显示。

我不应该像这样使用 rootViewController 吗?

【问题讨论】:

    标签: ios swift rootviewcontroller


    【解决方案1】:

    我认为您应该有一个级别的 rootViewController 来呈现所有内容,即只有 firstController 应该调用 presentViewController。

    【讨论】:

    • 感谢您的评论,但是 secondController 和 thirdController 都有一个按钮可以关闭自己。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多