ボタンをクリックすると、1つのクラスコントローラービューをサブビューとして表示する必要があるアプリケーションを開発しています。ビューコントローラーをサブビューとして追加しましたが、正常に動作します。
TempViewControlleriPad *tempScreen=[[TempViewControlleriPad alloc]initWithNibName:@"TempViewControlleriPad" bundle:nil];
[self.view addSubview:tempScreen.view];
[tempScreen viewWillAppear:NO];
デバイスの向きを回転すると、サブ ビューがその向きに反応しませんでした。これは、サブ ビューが回転しなかったことを意味します。
TempViewControlleriPad orientation method:-
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
[[NSBundle mainBundle] loadNibNamed:@"TempViewControlleriPad" owner:self options:nil];
}
else if(interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft){
[[NSBundle mainBundle] loadNibNamed:@"TempViewControlleriPadLandscape" owner:self options:nil];
}
return YES;
}
この向きの問題を解決するにはどうすればよいか教えてください。
前もって感謝します。