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

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

    <legend id='Iyd06'><style id='Iyd06'><dir id='Iyd06'><q id='Iyd06'></q></dir></style></legend>
      <bdo id='Iyd06'></bdo><ul id='Iyd06'></ul>
  1. <tfoot id='Iyd06'></tfoot>

      如何处理UIViewController的旋转,该rotoiewontroller在uinavigationContro

      时间:2023-05-18
      <i id='XYJxw'><tr id='XYJxw'><dt id='XYJxw'><q id='XYJxw'><span id='XYJxw'><b id='XYJxw'><form id='XYJxw'><ins id='XYJxw'></ins><ul id='XYJxw'></ul><sub id='XYJxw'></sub></form><legend id='XYJxw'></legend><bdo id='XYJxw'><pre id='XYJxw'><center id='XYJxw'></center></pre></bdo></b><th id='XYJxw'></th></span></q></dt></tr></i><div id='XYJxw'><tfoot id='XYJxw'></tfoot><dl id='XYJxw'><fieldset id='XYJxw'></fieldset></dl></div>

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

          <bdo id='XYJxw'></bdo><ul id='XYJxw'></ul>

              <tbody id='XYJxw'></tbody>
              • <legend id='XYJxw'><style id='XYJxw'><dir id='XYJxw'><q id='XYJxw'></q></dir></style></legend>

                <tfoot id='XYJxw'></tfoot>

              • 本文介绍了如何处理UIViewController的旋转,该rotoiewontroller在uinavigationController堆栈中没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我有一个根的UIViewController(VC1),一个UINavigationController,它处理通过手动调节其意见/子视图帧在willRotateToInterfaceOrientation轮换内:方法.旋转工作正常,如果根的UIViewController是活动视图控制器,基本上在堆栈的顶部.

                I have a root UIViewController (VC1), inside a UINavigationController, which handles rotation by adjusting its views/subviews frames manually in the willRotateToInterfaceOrientation: method. The rotation works fine if the root UIViewController is the active view controller, basically on top of the stack.

                当我推另一个的UIViewController(VC2),会出现问题到NavigationController.我再旋转VC2工作正常.然而,当我弹出VC2问题是,VC1为非旋转到正确的方向,也没有其willRotateToInterfaceOrientation:方法被调用?该shouldAutorotateToInterfaceOrientation:方法在VC1被称为但是那它

                The problem occurs when i push another UIViewController (VC2) onto the NavigationController. I then rotate VC2 which works fine. However when i pop VC2 the problem is that VC1 has not rotated to the correct orientation, nor does its willRotateToInterfaceOrientation: method get called?? The shouldAutorotateToInterfaceOrientation: method in VC1 is called but thats it.

                我的问题然后才是我应该如何确保我的UIViewController VC1已经为当前方向更新的这种情况?

                My question then is how am i supposed to make sure that my UIViewController VC1 has been updated for the current orientation for this type of situation??

                推荐答案

                我解决这个问题的方法是检查<代码> viewWillAppear中:以查看是否取向现在是不同的时<代码> viewDidDisappear 被调用.如果是这样我所说的代码来布局视图.

                The way I resolve this is to check on viewWillAppear: to see if the orientation is now different to when viewDidDisappear was called. If so I call the code to layout the view.

                要采用这种方法的第一因素负责布置视图成类似<代码> _layoutViews 的代码,可以简单地将其称为在<代码> viewWillAppear中以及在<代码所需> willRotateToInterfaceOrientation:

                To adopt this approach first factor the code responsible for laying out the view into something like _layoutViews, can simply call it as required in viewWillAppear as well as in willRotateToInterfaceOrientation:.

                这篇关于如何处理UIViewController的旋转,该rotoiewontroller在uinavigationController堆栈中没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:选项卡栏控制器内的视图控制器不会在旋转时自动调整大小 下一篇:将图像旋转 3*Double.pi/2 使图像不出现(swift3)

                相关文章

                <legend id='UkrIx'><style id='UkrIx'><dir id='UkrIx'><q id='UkrIx'></q></dir></style></legend>
              • <small id='UkrIx'></small><noframes id='UkrIx'>

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

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