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

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

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

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

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

        iOS 5 UINavigationBar 删除子视图(图像子视图)删除导

        时间:2023-05-30
              <bdo id='sYKmg'></bdo><ul id='sYKmg'></ul>
            • <legend id='sYKmg'><style id='sYKmg'><dir id='sYKmg'><q id='sYKmg'></q></dir></style></legend><tfoot id='sYKmg'></tfoot>

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

                <tbody id='sYKmg'></tbody>

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

                  本文介绍了iOS 5 UINavigationBar 删除子视图(图像子视图)删除导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  在我在 iOS 4 上运行良好的应用程序中,从 iOS 5 开始导航栏消失了.这是我认为导致问题的原因:我正在删除 RootViewController viewWillAppear 方法中的子视图:

                  In my application that works fine on iOS 4 navigationBar dissappeared starting iOS 5. Here is what I figured caused issue: I was removing subviews in RootViewController viewWillAppear method:

                  for(UIView* view in self.navigationController.navigationBar.subviews)
                      {
                          if ([view isKindOfClass:[UILabel class]]) 
                          {
                              [view removeFromSuperview];
                          }
                          if([view isKindOfClass:[UIImageView class]])
                          {
                              [view removeFromSuperview];
                          }
                      }
                  

                  我这样做是因为我推送到导航控制器上的第二个视图控制器将图像和标签添加到导航栏,当视图弹出时我必须删除它们.在 iOS 5 中,上面的代码删除了导航栏.如何解决此问题或以正确的方式支持 iOS4 和 iOS 5?

                  I was doing this because Second view controller that I push onto navigation controller add's image and label to navigation bar which I have to remove when view is popped. In iOS 5 the above code removes navigationBar. How to fix this or right way of doing it to support both iOS4 and iOS 5 ?

                  推荐答案

                  为这些图像和 uilabel 设置标签,然后从上面的代码中删除它就可以了.

                  setTag for those image and uilabel then removing it from code above did the trick.

                  for(UIView* view in self.navigationController.navigationBar.subviews)
                  {
                     if(view.tag == 9 || view.tag == 99)
                     {
                        [view removeFromSuperview];
                     }
                  }
                  

                  这篇关于iOS 5 UINavigationBar 删除子视图(图像子视图)删除导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:当 hidesBottomBarWhenPushed 为“TRUE"时如何隐藏自 下一篇:以编程方式读取 iPhone 设置(精确设置 -> 常规

                  相关文章

                  最新文章

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

                    <legend id='aefyZ'><style id='aefyZ'><dir id='aefyZ'><q id='aefyZ'></q></dir></style></legend>
                    1. <small id='aefyZ'></small><noframes id='aefyZ'>

                      <tfoot id='aefyZ'></tfoot>