• <legend id='ld203'><style id='ld203'><dir id='ld203'><q id='ld203'></q></dir></style></legend>

    <small id='ld203'></small><noframes id='ld203'>

      <bdo id='ld203'></bdo><ul id='ld203'></ul>
    <tfoot id='ld203'></tfoot>

    <i id='ld203'><tr id='ld203'><dt id='ld203'><q id='ld203'><span id='ld203'><b id='ld203'><form id='ld203'><ins id='ld203'></ins><ul id='ld203'></ul><sub id='ld203'></sub></form><legend id='ld203'></legend><bdo id='ld203'><pre id='ld203'><center id='ld203'></center></pre></bdo></b><th id='ld203'></th></span></q></dt></tr></i><div id='ld203'><tfoot id='ld203'></tfoot><dl id='ld203'><fieldset id='ld203'></fieldset></dl></div>

        如何在 Swift 中隐藏第一个 ViewController 的导航栏?

        How to hide a navigation bar from first ViewController in Swift?(如何在 Swift 中隐藏第一个 ViewController 的导航栏?)
        <tfoot id='1O5Ry'></tfoot>
      1. <legend id='1O5Ry'><style id='1O5Ry'><dir id='1O5Ry'><q id='1O5Ry'></q></dir></style></legend>

              <tbody id='1O5Ry'></tbody>

            <small id='1O5Ry'></small><noframes id='1O5Ry'>

              • <i id='1O5Ry'><tr id='1O5Ry'><dt id='1O5Ry'><q id='1O5Ry'><span id='1O5Ry'><b id='1O5Ry'><form id='1O5Ry'><ins id='1O5Ry'></ins><ul id='1O5Ry'></ul><sub id='1O5Ry'></sub></form><legend id='1O5Ry'></legend><bdo id='1O5Ry'><pre id='1O5Ry'><center id='1O5Ry'></center></pre></bdo></b><th id='1O5Ry'></th></span></q></dt></tr></i><div id='1O5Ry'><tfoot id='1O5Ry'></tfoot><dl id='1O5Ry'><fieldset id='1O5Ry'></fieldset></dl></div>

                  <bdo id='1O5Ry'></bdo><ul id='1O5Ry'></ul>

                  本文介绍了如何在 Swift 中隐藏第一个 ViewController 的导航栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  如何快速隐藏第一个 ViewController 或特定 ViewController 的导航栏?

                  How can I hide a navigation bar from first ViewController or a particular ViewController in swift?

                  我在 viewDidLoad() 中使用了以下代码:

                  I used the following code in viewDidLoad():

                  override func viewDidLoad() {
                      super.viewDidLoad()
                      self.navigationController?.isNavigationBarHidden = true
                  }
                  

                  以及viewWillAppear:

                  override func viewWillAppear(animated: Bool) {
                      self.navigationController?.isNavigationBarHidden = true
                  }
                  

                  这两种方法都对所有 ViewController 隐藏了导航控制器.

                  Both methods hide the navigation controller from all ViewControllers.

                  推荐答案

                  如果您知道所有其他视图都应该使栏可见,则可以使用 viewWillDisappear 将其再次设置为可见.

                  If you know that all other views should have the bar visible, you could use viewWillDisappear to set it to visible again.

                  在斯威夫特中:

                  override func viewWillAppear(_ animated: Bool) {
                      super.viewWillAppear(animated)
                      navigationController?.setNavigationBarHidden(true, animated: animated)
                  }
                  
                  override func viewWillDisappear(_ animated: Bool) {
                      super.viewWillDisappear(animated)
                      navigationController?.setNavigationBarHidden(false, animated: animated)
                  }
                  

                  这篇关于如何在 Swift 中隐藏第一个 ViewController 的导航栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  iOS 6 rotations: supportedInterfaceOrientations doesn#180;t work?(iOS 6 旋转:supportedInterfaceOrientations 不起作用?)
                  CABasicAnimation rotate returns to original position(CABasicAnimation 旋转返回原始位置)
                  UITabBarController Rotation Issues in ios 6(ios 6 中的 UITabBarController 旋转问题)
                  iOS: How to run a function after Device has Rotated (Swift)(iOS:设备旋转后如何运行函数(Swift))
                  How to rotate an image 90 degrees on iOS?(如何在 iOS 上将图像旋转 90 度?)
                  iOS 8 Rotation Methods Deprecation - Backwards Compatibility(iOS 8 旋转方法弃用 - 向后兼容性)

                  • <small id='KGtcA'></small><noframes id='KGtcA'>

                    <i id='KGtcA'><tr id='KGtcA'><dt id='KGtcA'><q id='KGtcA'><span id='KGtcA'><b id='KGtcA'><form id='KGtcA'><ins id='KGtcA'></ins><ul id='KGtcA'></ul><sub id='KGtcA'></sub></form><legend id='KGtcA'></legend><bdo id='KGtcA'><pre id='KGtcA'><center id='KGtcA'></center></pre></bdo></b><th id='KGtcA'></th></span></q></dt></tr></i><div id='KGtcA'><tfoot id='KGtcA'></tfoot><dl id='KGtcA'><fieldset id='KGtcA'></fieldset></dl></div>
                        <tbody id='KGtcA'></tbody>
                      • <bdo id='KGtcA'></bdo><ul id='KGtcA'></ul>
                        <legend id='KGtcA'><style id='KGtcA'><dir id='KGtcA'><q id='KGtcA'></q></dir></style></legend>

                          <tfoot id='KGtcA'></tfoot>