gpt4 book ai didi

ios - iOS 6 中方向定义的任何更改

转载 作者:行者123 更新时间:2023-11-28 22:47:31 25 4
gpt4 key购买 nike

我有这个:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

在我的应用程序 View Controller 中,在 iOS 5 中它按预期工作,但当我更新到 iOS 6 时,方向定义似乎不起作用,它在定向时也显示横向。任何其他设置的方法定义是否有变化?

最佳答案

AppDelegate 中:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window  // iOS 6
{

return UIInterfaceOrientationMaskAll;


}

在你的 ViewController 中:

- (BOOL)shouldAutorotate {
return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}

关于ios - iOS 6 中方向定义的任何更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12817996/

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