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

    1. <legend id='uORJh'><style id='uORJh'><dir id='uORJh'><q id='uORJh'></q></dir></style></legend>
      <tfoot id='uORJh'></tfoot>
      • <bdo id='uORJh'></bdo><ul id='uORJh'></ul>

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

        滑动回根视图控制器时,大型导航栏背景颜色变得清晰

        时间:2023-06-11

          <small id='40zzn'></small><noframes id='40zzn'>

              <bdo id='40zzn'></bdo><ul id='40zzn'></ul>

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

                2. <legend id='40zzn'><style id='40zzn'><dir id='40zzn'><q id='40zzn'></q></dir></style></legend>
                  本文介绍了滑动回根视图控制器时,大型导航栏背景颜色变得清晰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我已经使用了 largeNavigationBar 并且没关系,直到我滑回根视图控制器并且大导航以令人讨厌的方式获得清晰的颜色.代码如下:

                  I have used largeNavigationBar and it's ok until i swipe back to root view controller and large navigation gets clear color in a nasty way. Here's the code:

                  func largeNavigationTitle() {
                     
                      self.navigationController?.view.backgroundColor = VVUtility.navigationBarColor()
                      let productTitle = request?.product?.name
                      self.navigationItem.title = "(productTitle ?? " ")".localized()
                      self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.white, NSAttributedStringKey.font : VVUtility.normalFontWithPlusSize(increaseSize: -2.0)]
                      
                      if #available(iOS 11.0, *) {
                          self.navigationController?.navigationBar.prefersLargeTitles = true
                          self.navigationController?.navigationBar.backgroundColor = VVUtility.splashBackGroundColor()
                          self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.white, NSAttributedStringKey.font : VVUtility.normalFontWithPlusSize(increaseSize: 0.0)]
                      } else {
                          // Fallback on earlier versions
                      }
                      
                  }
                  

                  我在 viewWillAppearviewDidLoad

                  更新

                  这是两种状态的截图:

                  刷卡前:imgur.com/a/ZcSOrov

                  刷卡时:imgur.com/a/DYeeot8

                  推荐答案

                  试试这个.它应该将根视图控制器的导航栏颜色设置为您想要的颜色:

                  Try this. It should set your root View controller's navigationBar's colour to the one you wanted:

                  func largeNavigationTitle() {
                  
                      self.navigationController?.view.backgroundColor = VVUtility.navigationBarColor()
                     //add the two lines below
                      self.navigationController?.navigationBar.barTintColor = VVUtility.navigationBarColor()
                      self.navigationController?.navigationBar.isTranslucent = false
                  
                      let productTitle = request?.product?.name
                      self.navigationItem.title = "(productTitle ?? " ")".localized()
                      self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.white, NSAttributedStringKey.font : VVUtility.normalFontWithPlusSize(increaseSize: -2.0)]
                  
                      if #available(iOS 11.0, *) {
                          self.navigationController?.navigationBar.prefersLargeTitles = true
                          self.navigationController?.navigationBar.backgroundColor = VVUtility.splashBackGroundColor()
                          self.navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.white, NSAttributedStringKey.font : VVUtility.normalFontWithPlusSize(increaseSize: 0.0)]
                      } else {
                          // Fallback on earlier versions
                      }
                  
                  }
                  

                  这篇关于滑动回根视图控制器时,大型导航栏背景颜色变得清晰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在许多 UIVIewControllers 之间传递一个变量 下一篇:如何用新的 viewController 替换当前的 viewController

                  相关文章

                  <tfoot id='2ense'></tfoot>

                    • <bdo id='2ense'></bdo><ul id='2ense'></ul>

                    <small id='2ense'></small><noframes id='2ense'>

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