0

我的应用轮换在装有 iOS6 的 iPad 3 和 iPad 2 上正常工作,但在装有 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"]];
}

}

4

1 回答 1

2

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

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

ios5 中的方向支持

于 2012-11-14T13:58:49.967 回答