現在、ユーザーがデバイスを横向きに回転させたときに、ある画面から別の画面に移行したいアプリに取り組んでいます。私はこれを機能させていますが、トランジション中の画面は、次のビューが入ってくるのと同じように横向きに回転します。現在のビューが回転しないようにする一般的な解決策は、shouldAutoRotate メソッドに対して NO を返すことです。ただし、次の画面に遷移するには、これを有効にする必要があります。willRotateToInterfaceOrientation で [UIView setAnimationsEnabled:NO] も試しましたが、これはアニメーションを非表示にするだけで、現在のビューを横向きに回転させます。関連するすべての回転メソッドを次に示します。
-(BOOL)shouldAutorotate
{
return YES;
}
//Temporarily disable rotation animation
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[UIView setAnimationsEnabled:NO];
}
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[UIView setAnimationsEnabled:YES];
if(UIInterfaceOrientationLandscapeLeft)
[self performSegueWithIdentifier:@"landscapeView" sender:self];
}
-(NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
助言がありますか?前もって感謝します。