Ios8 Can';I don’我不知道如何在iOS 8中实现倒置定向?

Ios8 Can';I don’我不知道如何在iOS 8中实现倒置定向?,ios8,uiinterfaceorientation,appdelegate,device-orientation,uiscreen,Ios8,Uiinterfaceorientation,Appdelegate,Device Orientation,Uiscreen,我在AppDelegate.m中为iPhone 6添加了UIScreen边界代码,现在iPhone 6的设备方向不能用于纵向/倒置。倒置是模拟器和设备中不起作用的部分 AppDelegate.m中的代码 CGSize iosScreenSize = [[UIScreen mainScreen] bounds].size; if (iosScreenSize.height == 667) { UIStoryboard *iPhone6 = [UIStoryboard

我在AppDelegate.m中为iPhone 6添加了UIScreen边界代码,现在iPhone 6的设备方向不能用于纵向/倒置。倒置是模拟器和设备中不起作用的部分

AppDelegate.m中的代码

 CGSize iosScreenSize = [[UIScreen mainScreen] bounds].size;

    if (iosScreenSize.height == 667) {

        UIStoryboard *iPhone6 = [UIStoryboard storyboardWithName:@"iPhone6" bundle:nil];

        UIViewController *initialViewController =[iPhone6 instantiateInitialViewController];

        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];

        self.window.rootViewController = initialViewController;

        [self.window makeKeyAndVisible];
    }
当我包含上述代码时,iPhone 6的模拟器和设备不会检测到倒置方向。我还使用了nativeBounds和screenBounds,对于倒置方向也不起作用

我的设备定位代码

 -(NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
 }

我不知道该怎么做才能让AppDelegate代码检测到iPhone 6的倒置方向

好的,终于找到了这个

然后意识到有人在这里发布了答案:

到黑暗中去-ud0g的答案

我必须对我的选项卡栏控制器进行子类化,以覆盖该方法。非常讨厌.

看: