iOS6 では、autorotate は以前のバージョンとは異なり、UINavigation で動作する必要があります。UINavigation バーを備えた View_A があり、pushViewController:View_B と View_B pushViewController:C があります。したがって、View_A、View_B、および View_C はすべて自動回転できます。私の質問は、View_C で addsubview を使用して View_D をサブビューとして追加した場合、View_D は自動回転しません。iOS 6 でサブビューを自動回転する方法がわかりません。同じ質問がありましたか?
1 に答える
0
このコードを試してください:
- (BOOL)shouldAutorotate {
UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];
if (orientation==UIInterfaceOrientationPortrait) {
// do the UI changes
}
if(orientation==UIInterfaceOrientationLandscape){
// do UI changes
}
return YES;
}
于 2013-09-28T16:14:44.213 に答える