gpt4 book ai didi

iphone - 不使用 Storyboard的 iOS 6 屏幕旋转

转载 作者:可可西里 更新时间:2023-11-01 03:26:45 26 4
gpt4 key购买 nike

任何正在尝试最新的 iOS 6 beta(版本 2 或 3)的人都有同样的自动旋转不起作用的经历吗?

我没有使用 Storyboard ,而是使用了纯导航控件:

self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:navController.view];

并且有:

- (BOOL)shouldAutorotateToInterfaceOrientation: ](UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}

- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}

但 IOS 根本没有支持,在 3GS/4S 和 4.3、5.0.5.1 模拟器上与所有以前的 iOS 都能正常工作,但 iOS 6 似乎有问题

最佳答案

iOS 6 中的自动旋转发生了变化。在 iOS 6 中,UIViewControllershouldAutorotateToInterfaceOrientation: 方法已弃用。取而代之的是,您应该使用 supportedInterfaceOrientationsshouldAutorotate 方法。

Read more here .

关于iphone - 不使用 Storyboard的 iOS 6 屏幕旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11544382/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com