<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>

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

      时间:2023-06-10

          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")
                }
                

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

                上一篇:使 UIButton 充当导航控制器 下一篇:如何将基于故事板的 Header 和 CustomTableCell 添加到“搜索栏和搜索显示控制器"

                相关文章

                <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>

                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>