0
뷰 컨트롤러가 밀려와 하단의 탭 표시 줄과 같이 숨겨져 : 잘 작동루트보기 컨트롤러가 아닌데 hidesBottomBarWhenPushed가 작동하지 않는 이유는 무엇입니까?
let myViewController = self.storyboard?.instantiateViewController(withIdentifier: MyViewController) as! MyViewController
myViewController.hidesBottomBarWhenPushed = true
navigationController?.pushViewController(myViewController, animated: true)
합니다.
그러나 푸시하기 전에 루트보기 컨트롤러를 변경하면 하단 막대가 숨겨지지 않습니다.
// Change the root view controller
let firstRootViewController = UIApplication.shared.keyWindow!.rootViewController
UIApplication.shared.keyWindow!.rootViewController = secondRootViewController
// Push view on stack of navigation controller which is a child of firstRootViewController
let myViewController = self.storyboard?.instantiateViewController(withIdentifier: MyViewController) as! MyViewController
myViewController.hidesBottomBarWhenPushed = true
navigationController?.pushViewController(myViewController, animated: true)
// Some more things happen...
// Switch back to previous root view controller
UIApplication.shared.keyWindow!.rootViewController = firstRootViewController
결과는 탐색 컨트롤러 올바르게 myViewController
밀어 있지만 파라미터 hidesBottomBarWhenPushed
무시 것처럼 하단 바는 볼이다.
여기에 무슨 문제가 있습니까?