<tfoot id='2O5hN'></tfoot>
  • <small id='2O5hN'></small><noframes id='2O5hN'>

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

        <legend id='2O5hN'><style id='2O5hN'><dir id='2O5hN'><q id='2O5hN'></q></dir></style></legend>
        • <bdo id='2O5hN'></bdo><ul id='2O5hN'></ul>

      1. ios 6 中的 UITabBarController 旋转问题

        UITabBarController Rotation Issues in ios 6(ios 6 中的 UITabBarController 旋转问题)

      2. <small id='BNfyQ'></small><noframes id='BNfyQ'>

                <tbody id='BNfyQ'></tbody>

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

                • 本文介绍了ios 6 中的 UITabBarController 旋转问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  确认!我终于在 iOS 5 中解决了我的标签栏旋转问题,但 iOS 6 和 xcode 似乎有问题......这就是我所拥有的:

                  Ack! I had my tabbar rotation issues resolved finally in iOS 5, but iOS 6 and xcode seem to have broken things... here is what I have:

                  目标应用摘要包括:支持的界面方向 - 纵向、左侧横向、右侧横向

                  Target App Summary includes: Supported Interface Orientations - Portraint, Landscape Left, Landscape Right

                  App 中的每个 Single View 都有以下方法:

                  Every Single View in the App has the following methods:

                  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
                  {
                  if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
                      return ((interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown) &&
                              (interfaceOrientation != UIInterfaceOrientationLandscapeLeft) &&
                              (interfaceOrientation != UIInterfaceOrientationLandscapeRight));
                  } else {
                      return YES;
                  }
                  }
                  
                  - (BOOL)shouldAutorotate
                  {
                  NSLog(@"am I called1?");
                  return NO;
                  }
                  
                  -(NSUInteger)supportedInterfaceOrientations{
                     NSLog(@"am I called?");
                     return UIInterfaceOrientationMaskPortrait;
                  }
                  

                  在不属于标签栏的视图中,旋转被阻止.在标签栏的所有视图(有 5 个)中,应用程序从不调用 ShouldAutorotate 并因此旋转.似乎supportedInterfaceOrientations在视图加载时被调用一次,但在我在视图之间切换时不会出现,因为我得到了NSLog,但它似乎忽略了MaskPortrait设置.

                  In the views that are not part of the tab bar, rotation is blocked. In ALL the views of the tabbar (there are 5) the app never calls ShouldAutorotate and so rotates. It does seem supportedInterfaceOrientations gets called once when a view loads, but not when it appears if I switch between views, because I get the NSLog, but it seems to ignore the MaskPortrait setting.

                  我必须在目标中启用横向,因为我有一个需要旋转的视频播放器视图(它这样做,很好)

                  I have to leave the landscape enabled in the target because I have a single video player view that needs to rotate (and it does so, fine)

                  这是 iOS 6 中的标签栏错误吗?我是否需要以不同的方式禁用视图的旋转?shouldautorotatetointerfaceorientation 在 ios 5 中效果很好

                  Is this a tabbar bug in iOS 6? Do I need to disable the rotation of the views differently? The shouldautorotatetointerfaceorientation worked great in ios 5

                  我已经有一段时间了

                  谢谢,扎克

                  推荐答案

                  Zack,我也遇到了同样的问题.这是因为您将 viewController 嵌入到 TabBar 控制器或 UINavigationController 中,并且对这些方法的调用发生在这些方法中,而不是您的普通 View(在 iOS6 中更改).

                  Zack, I ran into this same issue. It's because you have your viewController embedded inside of a TabBar Controller or UINavigationController and the calls to these methods are happening inside those instead of your normal View (Changed in iOS6).

                  我遇到了这个问题,因为我在所有具有不同视图(注册过程、登录等)导航的模态视图上都展示了一个嵌入 UINavigationController 中的 viewController.

                  I ran into this issue because I was presenting a viewController embedded inside a UINavigationController on all my modal views that had Navigation to different views (Signup Process, Login, etc).

                  我的简单解决方法是为包含这两种方法的 UINavigationController 创建一个 CATEGORY.我有 shouldAutorotate 无论如何都返回 NO,因为我不希望我的模态视图旋转.你的修复可能就是这么简单,试一试.希望对您有所帮助.

                  My simple fix was to create a CATEGORY for UINavigationController that includes these two methods. I have shouldAutorotate returning NO anyway because I don't want my modal views rotating. Your fix may be this simple, give it a try. Hope it helps.

                  我创建了一个类别并将其命名为 autoRotate 并选择了 UINavigationController 选项.M+H文件如下.

                  I created a category and named it autoRotate and selected theUINavigationController option. The M+H file are below.

                  #import "UINavigationController+autoRotate.h"
                  
                  @implementation UINavigationController (autoRotate)
                  
                  -(BOOL)shouldAutorotate {
                      return NO;
                  }
                  
                  - (NSUInteger)supportedInterfaceOrientations {
                      return UIInterfaceOrientationMaskPortrait;
                  }
                  
                  @end
                  

                  ...和类别 .h:

                  #import <UIKit/UIKit.h>
                  
                  @interface UINavigationController (autoRotate)
                  
                  -(BOOL)shouldAutorotate;
                  - (NSUInteger)supportedInterfaceOrientations;
                  
                  @end
                  

                  这篇关于ios 6 中的 UITabBarController 旋转问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How To Create a Rotating Wheel Control?(如何创建转轮控件?)
                  iOS 6 rotations: supportedInterfaceOrientations doesn#180;t work?(iOS 6 旋转:supportedInterfaceOrientations 不起作用?)
                  CABasicAnimation rotate returns to original position(CABasicAnimation 旋转返回原始位置)
                  How to avoid restarting activity when orientation changes on Android(如何在 Android 上的方向更改时避免重新启动活动)
                  iOS: How to run a function after Device has Rotated (Swift)(iOS:设备旋转后如何运行函数(Swift))
                  How to rotate an image 90 degrees on iOS?(如何在 iOS 上将图像旋转 90 度?)
                  <legend id='kncUH'><style id='kncUH'><dir id='kncUH'><q id='kncUH'></q></dir></style></legend>

                    <tfoot id='kncUH'></tfoot>
                      <tbody id='kncUH'></tbody>

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

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

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