ビュー、UIImageView、およびボタンをプログラムで作成しました。問題は、デバイスが縦向きから横向きに切り替わった場合に位置を更新する必要があることです。どうすればよいですか?
これは、デバイスがポートレート モードかランドスケープ モードかを確認するコードである必要があります。
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
}
else
{
}
}