gpt4 book ai didi

iphone - ios6 从横向模式到纵向模式的旋转问题

转载 作者:行者123 更新时间:2023-12-03 18:56:30 26 4
gpt4 key购买 nike

我正在使用 ios 6 的新方向方法,它工作正常。我的 View 以纵向模式呈现,当我呈现 viewcotrnoller 并将其旋转到横向时,关闭该 View Controller ,它会恢复方向。意味着它应该保持横向,但变成纵向。这是我的代码。

- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;

}

// Tell the system It should autorotate
- (BOOL) shouldAutorotate {
return YES;
}

// Tell the system which initial orientation we want to have
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationMaskPortrait;
}

我认为这是由于preferredInterfaceOrientationForPresentation方法而发生的,但没有得到解决方案。请帮助!

谢谢!!

最佳答案

如果您希望一开始就支持所有接口(interface)方向,请不要编写preferredInterfaceOrientationForPresentation 方法,因为它始终只采用首选接口(interface)方向。

关于iphone - ios6 从横向模式到纵向模式的旋转问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12708652/

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