4 つのタブを持つ Tabbar アプリケーションを作成しています。FirstTabView はすべての向きをサポートし、3 つの tabViews はすべて縦向きのみをサポートする必要があります。タブを SecondTabView に変更すると、向きを強制的に縦向きに変更する必要があります。これは、以下で使用したストーリーボードで可能ですFirstTabView.m のコード
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
および SecondTabView.m で
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationPortrait);
}
タブビューが横向きをサポートすることは許可されていません。