私はIF文を使用して、デバイスの向きがいつ変化するかを検出し、それが起こると、新しいビューが表示され、1つのポートレート、もう1つのランドスケープが表示されます。唯一の問題は、私がポートレートから風景に回転し、風景ビューが示す場合、それはすべての方法で回転していないことです。まだ肖像画になっていて、90度の角度になっています。ご協力いただきありがとうございます!ビューが正しく回転しない
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
//portrait
self.view = portrait;
} else {
//landscape
self.view = landscape;
}
}
完璧、ありがとう! –