<tfoot id='vGlGD'></tfoot>

    <small id='vGlGD'></small><noframes id='vGlGD'>

      • <bdo id='vGlGD'></bdo><ul id='vGlGD'></ul>

      <legend id='vGlGD'><style id='vGlGD'><dir id='vGlGD'><q id='vGlGD'></q></dir></style></legend>
      <i id='vGlGD'><tr id='vGlGD'><dt id='vGlGD'><q id='vGlGD'><span id='vGlGD'><b id='vGlGD'><form id='vGlGD'><ins id='vGlGD'></ins><ul id='vGlGD'></ul><sub id='vGlGD'></sub></form><legend id='vGlGD'></legend><bdo id='vGlGD'><pre id='vGlGD'><center id='vGlGD'></center></pre></bdo></b><th id='vGlGD'></th></span></q></dt></tr></i><div id='vGlGD'><tfoot id='vGlGD'></tfoot><dl id='vGlGD'><fieldset id='vGlGD'></fieldset></dl></div>

      为什么我的视图仍然以横向显示?

      why is my view still presented in landscape?(为什么我的视图仍然以横向显示?)

          1. <legend id='Po2rZ'><style id='Po2rZ'><dir id='Po2rZ'><q id='Po2rZ'></q></dir></style></legend>
              • <bdo id='Po2rZ'></bdo><ul id='Po2rZ'></ul>
                  <tbody id='Po2rZ'></tbody>
              • <i id='Po2rZ'><tr id='Po2rZ'><dt id='Po2rZ'><q id='Po2rZ'><span id='Po2rZ'><b id='Po2rZ'><form id='Po2rZ'><ins id='Po2rZ'></ins><ul id='Po2rZ'></ul><sub id='Po2rZ'></sub></form><legend id='Po2rZ'></legend><bdo id='Po2rZ'><pre id='Po2rZ'><center id='Po2rZ'></center></pre></bdo></b><th id='Po2rZ'></th></span></q></dt></tr></i><div id='Po2rZ'><tfoot id='Po2rZ'></tfoot><dl id='Po2rZ'><fieldset id='Po2rZ'></fieldset></dl></div>

                <tfoot id='Po2rZ'></tfoot>
              • <small id='Po2rZ'></small><noframes id='Po2rZ'>

              • 本文介绍了为什么我的视图仍然以横向显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我的视图由导航控制器控制,因此我将支持的方向设置到导航控制器中以显式纵向 &PortraitUpSideDown 并且这有效,但是如果在调用视图时之前的视图处于横向状态,它将以横向形式呈现并保持横向状态,直到设备旋转.我该如何防止这种情况发生?

                my view is controlled by a navigation controller, so I set the supported orientations in to the navigation controller to explicitly portrait & portraitUpSideDown and this works, however if the previous view was in landscape when the view was called upon, it will present itself in landscape and stay in landscape until the device is rotated.. How do I prevent this?

                这是我的代码:

                class EditProfileViewController: UIViewController, UINavigationControllerDelegate
                
                override func viewDidLoad() {
                        super.viewDidLoad()
                
                        navigationController?.delegate = self
                }
                
                func navigationControllerSupportedInterfaceOrientations(navigationController: UINavigationController) -> UIInterfaceOrientationMask {
                
                    return [UIInterfaceOrientationMask.Portrait, UIInterfaceOrientationMask.PortraitUpsideDown]
                }
                

                我以为上一行会将视图永久锁定为纵向,我该怎么做?

                I thought the previous line would lock the view into portrait permanently, how do I do so?

                推荐答案

                您可以在关闭它之前将方向更改回纵向:

                You can change your orientation back to portrait before dismissing it:

                UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
                
                dismiss(animated: true) { _ in
                    print("dismissed in Portrait mode")
                }
                

                这篇关于为什么我的视图仍然以横向显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                How to add a navigation controller programmatically in code but not as initial view controller(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                View being blocked by UITransitionView after being presented(呈现后被 UITransitionView 阻止的视图)

                  <i id='9Igxy'><tr id='9Igxy'><dt id='9Igxy'><q id='9Igxy'><span id='9Igxy'><b id='9Igxy'><form id='9Igxy'><ins id='9Igxy'></ins><ul id='9Igxy'></ul><sub id='9Igxy'></sub></form><legend id='9Igxy'></legend><bdo id='9Igxy'><pre id='9Igxy'><center id='9Igxy'></center></pre></bdo></b><th id='9Igxy'></th></span></q></dt></tr></i><div id='9Igxy'><tfoot id='9Igxy'></tfoot><dl id='9Igxy'><fieldset id='9Igxy'></fieldset></dl></div>
                    <tbody id='9Igxy'></tbody>

                  1. <small id='9Igxy'></small><noframes id='9Igxy'>

                    <tfoot id='9Igxy'></tfoot>
                      <legend id='9Igxy'><style id='9Igxy'><dir id='9Igxy'><q id='9Igxy'></q></dir></style></legend>

                        • <bdo id='9Igxy'></bdo><ul id='9Igxy'></ul>