我有一个非常标准的 iPad 应用程序,它设置为仅横向显示。为了实现这一点,我将初始界面方向设置为横向,并将支持界面方向设置为单个横向左主页按钮,并将 shouldAutorotateToInterfaceOrientation 属性重写为以下内容:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
BOOL b = UIInterfaceOrientationIsLandscape(interfaceOrientation);
return b;
}
真正奇怪的是,当应用程序启动时,它是正确的,并且将 iPad 颠倒旋转没有任何反应,但是按下主页按钮旋转会旋转屏幕,但一旦旋转,它就永远不会旋转回来,所以认为这不是旋转设置。
有人遇到过这种情况吗?
最佳答案
来自文档:
#define UIInterfaceOrientationIsLandscape(orientation) \
((orientation) == UIInterfaceOrientationLandscapeLeft || \
(orientation) == UIInterfaceOrientationLandscapeRight)
因此,如果您只想支持一种景观旋转,这不是正确的选择...
关于ios - 奇怪的 iPad 旋转效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7151390/