Hide、UITabBar場配向変化
-
10-07-2019 - |
質問
私は非常に簡単な質問にも答えはそれほど簡単ではありません。
い隠UITabBar自分の配向変化します。
私は2つの方法:
フレーム方
myAppDelegate.tabBarController.tabBar.frame = CGRectMake(<<bottomOfScreen>>);
働きがいの空白領域で、試遊tabBarController.ます。フレームet myViewController.ます。フレームがなかったもの好成績を収めることができた。
ナビコントローラー方法
myOtherVC.hideTabBarWhenPushed = YES;
[self.navigationController pushViewController:myOtherVC animated:NO];
作品がなソリューションのための私のアプリ
更新:
[appDelegate.tabBarController.view removeFromSuperview];
[self.view removeFromSuperview]; [appDelegate.window addSubview:self.view];
self.view.frame = CGRectMake(0,0,480,320);
動作しなautorotateう(もちろん、変わらないんだよねのshouldAutorotateで返しますあり)
たいのですがhiddeっtabBarの現在のビューを始めとした。
感謝
解決
利用でき、現在の溶液に合わせ:
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:@"UIDeviceOrientationDidChangeNotification" object:nil];
検出回転します。(思いること。transform=CGAffineTransformMakeRotationで回転し...?)
他のヒント
これを簡単に行えると思う2つの方法は次のとおりです。
- オブジェクトを再読み込みしてtabBarコントローラーに戻す-非表示にするviewControllerのhidesBottomBarWhenPushedをYESに設定します。
- 他のオプションは、電話機を回転させたときにビューをウィンドウの唯一のビューにし、電話機を回転させたときにtabBarController.viewをウィンドウに戻すことです
これが役立つことを願って
所属していません StackOverflow