<tfoot id='08CwA'></tfoot>

      <small id='08CwA'></small><noframes id='08CwA'>

    1. <legend id='08CwA'><style id='08CwA'><dir id='08CwA'><q id='08CwA'></q></dir></style></legend>

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

        Swift导航栏背景颜色白色不起作用

        时间:2023-06-12

          <legend id='MYOsa'><style id='MYOsa'><dir id='MYOsa'><q id='MYOsa'></q></dir></style></legend>

        1. <tfoot id='MYOsa'></tfoot>

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

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

                  本文介绍了Swift导航栏背景颜色白色不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我很难将 navigationBar.barTintColor 更改为白色.奇怪的是,所有其他颜色都可以,但不是白色!

                  Im having a difficult time trying to change the navigationBar.barTintColor to white. Strangely, all other colors work, but not white!

                  self.navigationController!.navigationBar.barTintColor = UIColor.whiteColor()
                  

                  以上行不适用于白色.

                  甚至尝试使用背景图片.还是一样.任何其他颜色都可以,但不是白色!!白色总是被浅灰色代替...

                  Even tried with a background image. Still the same. Any other color works but not white!! White is always replaced by light grey...

                  请指教我哪里出错了...

                  Please advice where I am going wrong...

                  谢谢.

                  推荐答案

                  试试这个代码:

                  在你看来DidLoad:

                  In your viewDidLoad:

                      title = "Some Title"
                  
                      UIApplication.shared.statusBarStyle = .default
                      navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
                      navigationController?.navigationBar.shadowImage = UIImage()
                      navigationController?.navigationBar.isTranslucent = true
                  
                      //Line under NavigationBar
                      let barView = UIView(frame: CGRect(x:0, y:(UINavigationController().navigationBar.frame.height + UIApplication.shared.statusBarFrame.height), width:view.frame.width, height:0.6))
                      barView.backgroundColor=UIColor.red // set any colour you want..
                      navigationController?.navigationBar.addSubview(barView)
                  
                      //Title Colour
                       navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.red]
                  

                  注意:

                  以上代码适用于任何背景颜色....如果您希望导航栏为绿色....将您的视图背景颜色设置为绿色...

                  Above code works on any background colour.... If you want the navigationBar to be green....set your view background colour to green...

                  这篇关于Swift导航栏背景颜色白色不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:一个视图控制器ios的强制横向 下一篇:如何从 MODAL 视图控制器中隐藏 iPad 键盘?

                  相关文章

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

                2. <small id='o4NhW'></small><noframes id='o4NhW'>

                    1. <legend id='o4NhW'><style id='o4NhW'><dir id='o4NhW'><q id='o4NhW'></q></dir></style></legend>

                    2. <tfoot id='o4NhW'></tfoot>
                        <bdo id='o4NhW'></bdo><ul id='o4NhW'></ul>