0

アプリのローテーションは、iOS6 の iPad 3 および iPad 2 では正しく機能しますが、iOS5 の iPad1 では機能しません。

タブバーコントローラーと5つのビューコントローラーを使用しています。各View Controllerに次のコードがあります:

- (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 に答える