iOSでは、ビューを回転に配置および移動しても、サブビューのUI要素(ボタンとラベル)は再描画されません。subViewはメインビューのサブビューです。
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (UIInterfaceOrientationIsPortrait(fromInterfaceOrientation)) {
self.subView.frame = CGRectMake(0, 0, 100, 200);
} else {
self.subView.frame = CGRectMake(0, 0, 200, 1000);
}
self.subView.contentMode = UIViewContentModeRedraw;
[self.subView setNeedsLayout];
[UIView commitAnimations];
}
subViewのUI要素を再描画するにはどうすればよいですか?
注:subViewの場所を元の場所から変更しました