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

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

      1. 透明 UINavigationBar

        Transparent UINavigationBar(透明 UINavigationBar)

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

            • <bdo id='YSIA1'></bdo><ul id='YSIA1'></ul>

                <legend id='YSIA1'><style id='YSIA1'><dir id='YSIA1'><q id='YSIA1'></q></dir></style></legend>
                <i id='YSIA1'><tr id='YSIA1'><dt id='YSIA1'><q id='YSIA1'><span id='YSIA1'><b id='YSIA1'><form id='YSIA1'><ins id='YSIA1'></ins><ul id='YSIA1'></ul><sub id='YSIA1'></sub></form><legend id='YSIA1'></legend><bdo id='YSIA1'><pre id='YSIA1'><center id='YSIA1'></center></pre></bdo></b><th id='YSIA1'></th></span></q></dt></tr></i><div id='YSIA1'><tfoot id='YSIA1'></tfoot><dl id='YSIA1'><fieldset id='YSIA1'></fieldset></dl></div>
                    <tbody id='YSIA1'></tbody>
                • <tfoot id='YSIA1'></tfoot>
                  本文介绍了透明 UINavigationBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Am newbie to ios and I found this solution on making the UINavigationBar Transparent. Where in my project files can I put this code

                  [self.navigationBar setBackgroundImage:[UIImage new]
                                       forBarMetrics:UIBarMetricsDefault];
                  self.navigationBar.shadowImage = [UIImage new];
                  self.navigationBar.translucent = YES;
                  

                  So that it is applied in my entire project where navigation controller is being used.

                  解决方案

                  Put in your viewDidLoad function of your rootViewController this code:

                  Objective-C:

                  [self.navigationController.navigationBar setBackgroundImage:[UIImage new]
                                       forBarMetrics:UIBarMetricsDefault];
                  self.navigationController.navigationBar.shadowImage = [UIImage new];
                  self.navigationController.navigationBar.translucent = YES;
                  self.navigationController.view.backgroundColor = [UIColor clearColor];
                  

                  Swift 2.x:

                  if let navigationBar = navigationController?.navigationBar {
                          navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default)
                          navigationBar.shadowImage = UIImage()
                          navigationBar.translucent = true
                          navigationController?.view.backgroundColor = .clearColor()
                      }
                  

                  Swift 3:

                  if let navigationBar = navigationController?.navigationBar {
                          navigationBar.setBackgroundImage(UIImage(), for: .default)
                          navigationBar.shadowImage = UIImage()
                          navigationBar.isTranslucent = true
                          navigationController?.view?.backgroundColor = .clear
                      }
                  

                  This works for sure! Transparent UINavigationBar.

                  这篇关于透明 UINavigationBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                  ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                  Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                  How to add a navigation controller programmatically in code but not as initial view controller(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                  View being blocked by UITransitionView after being presented(呈现后被 UITransitionView 阻止的视图)
                  • <bdo id='ELRL0'></bdo><ul id='ELRL0'></ul>

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

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

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