界面旋转在iOS 6上工作但在iOS5上不工作

时间:2012-11-14 13:00:25

标签: ios uiview rotation ios6 uitabbarcontroller

我的应用程序轮换在iPad 3和iPad 2上使用iOS6正常工作,但在使用iOS5的iPad1上无效。

我正在使用标签栏控制器和5个视图控制器。在每个视图控制器上我都有这个代码:

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration{
if(self.interfaceOrientation == UIDeviceOrientationPortrait||self.interfaceOrientation == UIDeviceOrientationPortraitUpsideDown){
    self.view=self.VerticaleAppunti;
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"FONDO_VERT.jpg"]];
}
if(self.interfaceOrientation == UIDeviceOrientationLandscapeLeft||self.interfaceOrientation == UIDeviceOrientationLandscapeRight){
    self.view=self.OrizzontaleAppunti;
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"FONDO.jpg"]];
}

}

1 个答案:

答案 0 :(得分:2)

您可以尝试在ios 5中实现此方法以进行方向更改:

    - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
   //support for all orientation change 
    return YES;
}

orientation support in ios5