多数の UIView と画像が読み込まれた iPad アプリがあります。1 つの向きでは正常に機能しますが、すべての向きで機能させる必要があります。UIDeviceOrientationDidChangeNotification を購読しています。デバイスがどの方向を向いているかがわかったら、UI をリセットする必要があります。私が今行っていることは、各 UIView を手動で調べてその原点を変更し、そのビュー内にあるものは何でも原点を再構成することです。ビューを回転させる簡単な方法はありますか? 例 :
- (void)orientationChanged:(NSNotification *)notification
{
UIDeviceOrientation oriantation;
newOrientation=[[UIDevice currentDevice] orientation];
switch (newOrientation) {
case UIDeviceOrientationLandscapeRight:
CGRect landscaperight = self.view.frame;
landscaperight.origin.x -= 768;
self.view.frame = landscaperight;
break;
}
ここでの問題は、作業するビューがたくさんあることです。そのため、このタスクを処理するより簡単な方法があれば幸いです。
ありがとう。