• <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]后恢复

        时间:2023-06-10
          <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]后恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:获取最顶层的 UIViewController 下一篇:如何创建 pinterest 风格的隐藏/取消隐藏导航/标签栏?

                  相关文章

                      <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>
                      • <bdo id='nYCgL'></bdo><ul id='nYCgL'></ul>

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