相关疑难解决方法(0)

无法在iOS 6中处理方向?

我在用

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

委托根据方向类型更改视图的框架

if(UIInterfaceOrientationIsLandscape(interfaceOrientation))
{
    self.view.frame=CGRectMake(0,0,500,300);
}
else
{
    self.view.frame=CGRectMake(0,0,300,400);
}
Run Code Online (Sandbox Code Playgroud)

如何在iOS 6中处理相同的情况

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
Run Code Online (Sandbox Code Playgroud)

已在iOS6中弃用.

我正在使用以下委托来设置所有方向.

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationAllMask;
}
Run Code Online (Sandbox Code Playgroud)

但,

-(BOOL)shouldAutoRotate
{
    return YES;

}
Run Code Online (Sandbox Code Playgroud)

没有被调用.如何处理这种情况?

在此输入图像描述

ipad uiinterfaceorientation autoresizingmask ios6 iphone-5

20
推荐指数
1
解决办法
1万
查看次数