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

      <tfoot id='0B76d'></tfoot>

      <small id='0B76d'></small><noframes id='0B76d'>

      1. 将navigationBar背景图片设置为[UIImage new]后恢复

        Restore navigationBar background image after setting it to [UIImage new](将navigationBar背景图片设置为[UIImage new]后恢复)
          <tbody id='qhbNH'></tbody>
        • <bdo id='qhbNH'></bdo><ul id='qhbNH'></ul>

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

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

                <tfoot id='qhbNH'></tfoot>

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

                  本文介绍了将navigationBar背景图片设置为[UIImage new]后恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要一个完全透明的 mapView 导航栏,所以我这样做了:

                  I needed a completely transparent navigation bar for the mapView so I did this:

                  [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
                  [self.navigationController.navigationBar setShadowImage:[UIImage new]];
                  

                  返回所需的效果,如下所示:

                  That returns the desired effect, as seen here:

                  现在我去任何其他地方时都会遇到问题,因为我的导航栏保持透明:

                  Now I have a problem when I go to any other because my navigationBar remains transparent:

                  如何恢复navigationBar的backgroundImage和shadowImage的默认设置?

                  How do I restore default settings of the navigationBar's backgroundImage and shadowImage?

                  推荐答案

                  在地图视图的 viewWillDisappear 上为导航控制器的图像设置 nil

                  Set nil for image of navigation Controller on viewWillDisappear on map view

                  在你的地图视图中设置这两种方法

                  Set this two method in your mapview

                  地图视图.m

                  -(void)viewWillAppear:(BOOL)animated{
                      [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
                      [self.navigationController.navigationBar setShadowImage:[UIImage new]];
                  }
                  
                  -(void)viewWillDisappear:(BOOL)animated{
                      [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
                      [self.navigationController.navigationBar setShadowImage:nil];
                  }
                  

                  这篇关于将navigationBar背景图片设置为[UIImage new]后恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 阻止的视图)

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

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