0
0

More than 1 year has passed since last update.

[Swift] 画面遷移時にタブバーを非表示にする

Posted at

前提

MainViewController→TransitionViewに遷移する際に、遷移先のTransitionViewでタブバーを非表示にしたい。
TransitionView→MainViewControllerに戻る際には、タブバーを再表示する。

実装内容

navigationViewControllerにTransitionViewをpushする前に、
MainViewControllerのhidesBottomBarWhenPushedをtrueに設定し、
push後にhidesBottomBarWhenPushedをfalseに設定。

TransitionViewに遷移するコード
        self.hidesBottomBarWhenPushed = true  //push遷移前に設定
        self.navigationController?.pushViewController(transitionView, animated: true)
        self.hidesBottomBarWhenPushed = false  //push遷移後に設定
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0