LoginSignup
9
8

More than 5 years have passed since last update.

特定のViewControllerでナビゲーションバーを隠したい

Posted at

もっと良いやり方があれば教えて下さい :pray:

やったこと

ViewController.swift

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        // ナビゲーションバーは表示しない
        self.navigationController?.setNavigationBarHidden(true, animated: true)
    }

    override func viewWillDisappear(animated: Bool) {
        super.viewWillDisappear(animated)
        // ナビゲーションを表示する
        self.navigationController?.setNavigationBarHidden(false, animated: true)
    }

また、Storyboardでナビゲーションバーが表示される場合は、Simulated MetricsのTopBarをnoneにしました。

Kobito.cqIyPV.png

参考

9
8
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
9
8