応答が遅れて申し訳ありませんが、コードを取得しました。デバイスを回転させて、横向きのみのフルスクリーンで「マップ ビュー」を表示する方法を確認できます。
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if(toInterfaceOrientation == UIInterfaceOrientationLandscapeRight || toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
[self hideTabBar:self.tabBarController];
[self.view bringSubviewToFront:self.eventsMapView];
self.eventsMapView.bounds = self.view.bounds;
self.eventsMapView.frame = CGRectMake(0, -208, self.view.frame.size.width, 300);
} else if(toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown || toInterfaceOrientation == UIInterfaceOrientationPortrait) {
[self showTabBar:self.tabBarController];
[self.view sendSubviewToBack:self.eventsMapView];
}
}
そして、その中でメソッドを呼び出して実際にタブ バーを非表示および表示するため、.m ファイルでもこれらのメソッドを定義する必要があります。
#pragma mark - Tab Bar Methods -
-(void)hideTabBar:(UITabBarController *)tabbarcontroller {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
for(UIView *view in tabbarcontroller.view.subviews) {
if([view isKindOfClass:[UITabBar class]]) {
[view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
}
}
[UIView commitAnimations];
}
-(void)showTabBar:(UITabBarController *)tabbarcontroller {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
for(UIView *view in tabbarcontroller.view.subviews) {
if([view isKindOfClass:[UITabBar class]]) {
[view setFrame:CGRectMake(view.frame.origin.x, 431, view.frame.size.width, view.frame.size.height)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 431)];
}
}
[UIView commitAnimations];
}
既に Tab Bar Controller 内にいる場合は、以下のように、すべての子 (または個々のタブ ViewController) が向きに対して TRUE を返すようにする必要があります。
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return TRUE;
}
これがお役に立てば幸いです-質問がある場合はコメントを残してください。回答を更新して、よりよく見せるようにします。