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

      1. <small id='ftH1u'></small><noframes id='ftH1u'>

        <tfoot id='ftH1u'></tfoot>

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

        <legend id='ftH1u'><style id='ftH1u'><dir id='ftH1u'><q id='ftH1u'></q></dir></style></legend>
      3. iOS 6 shouldAutorotate: 没有被调用

        时间:2023-05-19

      4. <i id='PIzc5'><tr id='PIzc5'><dt id='PIzc5'><q id='PIzc5'><span id='PIzc5'><b id='PIzc5'><form id='PIzc5'><ins id='PIzc5'></ins><ul id='PIzc5'></ul><sub id='PIzc5'></sub></form><legend id='PIzc5'></legend><bdo id='PIzc5'><pre id='PIzc5'><center id='PIzc5'></center></pre></bdo></b><th id='PIzc5'></th></span></q></dt></tr></i><div id='PIzc5'><tfoot id='PIzc5'></tfoot><dl id='PIzc5'><fieldset id='PIzc5'></fieldset></dl></div>
        • <small id='PIzc5'></small><noframes id='PIzc5'>

          <legend id='PIzc5'><style id='PIzc5'><dir id='PIzc5'><q id='PIzc5'></q></dir></style></legend>
            <tbody id='PIzc5'></tbody>
          • <bdo id='PIzc5'></bdo><ul id='PIzc5'></ul>

                <tfoot id='PIzc5'></tfoot>
                  本文介绍了iOS 6 shouldAutorotate: 没有被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我一直在互联网上寻找解决方案,但一无所获.我正在尝试使我的 iOS 5 应用程序与 iOS 6 兼容.我无法让方向的东西正常工作.我无法检测到何时将发生轮换.这是我正在尝试的代码:

                  I have been scouring the internet for a solution to this but am finding nothing. I am trying to make my iOS 5 app iOS 6 compatible. I cannot get the orientation stuff to work right. I am unable to detect when a rotation is about to happen. Here is the code I am trying:

                  - (BOOL)shouldAutorotate {
                      return NO;
                  }
                  
                  - (NSUInteger)supportedInterfaceOrientations {
                      return UIInterfaceOrientationMaskPortrait;
                  }
                  // pre-iOS 6 support
                  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
                      return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
                  }
                  

                  新的supportedInterfaceOrientation: 方法被调用得很好.但是, shouldAutorotate 方法不会触发.我需要在旋转时进行一些图像交换,但没有任何迹象表明旋转即将发生.

                  The new supportedInterfaceOrientation: method gets called just fine. The shouldAutorotate method, however, will not fire. I need to do some image swapping on rotate, but I can't get any indication that a rotation is about to occur.

                  提前致谢.

                  推荐答案

                  查看你的应用启动时是否出现以下错误.

                  See if you are getting the following error when your App starts.

                  应用程序窗口应该在应用程序启动结束时有一个根视图控制器

                  Application windows are expected to have a root view controller at the end of application launch

                  如果是这样,修复它的方法是在 AppDelegate.m 文件中进行以下更改(尽管似乎有很多答案如何解决这个问题):

                  If so the way to fix it is by making the following change in the AppDelegate.m file (although there seem to be a number of answers how to fix this):

                  // Replace
                  [self.window addSubview:[navigationController view]];  //OLD
                  
                  // With
                  [self.window setRootViewController:navigationController];  //NEW
                  

                  在此之后 shouldAutoRotate 应该被正确调用.

                  After this shouldAutoRotate should be correctly called.

                  这篇关于iOS 6 shouldAutorotate: 没有被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 Objective-C 中旋转 UIButton 和 UILabel 的文本? 下一篇:如何在 Swift 中旋转 UIButton 和 UILabel 的文本?

                  相关文章

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

                    1. <legend id='vAqaq'><style id='vAqaq'><dir id='vAqaq'><q id='vAqaq'></q></dir></style></legend>

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

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

                    2. <tfoot id='vAqaq'></tfoot>