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

      <bdo id='tHogN'></bdo><ul id='tHogN'></ul>

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

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

      iOS 5 [UINavigationBar 外观] setBackgroundImage 不起作用

      时间:2023-06-12
      <tfoot id='Wi22d'></tfoot>

              <tbody id='Wi22d'></tbody>

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

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

                本文介绍了iOS 5 [UINavigationBar 外观] setBackgroundImage 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在 Xcode 4.2 Build 4D199 中创建了一个新的测试 iOS5 项目,并尝试如上所述设置 UINavigationBar 的外观,但没有任何反应.

                I created a new test iOS5 project in Xcode 4.2 Build 4D199 and tried to set the appearance of the UINavigationBar as described above, but nothing happens.

                我在viewDidLoad中试过的代码:

                [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar-iphone.png"] forBarMetrics:UIBarMetricsDefault];
                

                我可以让它工作的唯一方法是在 UINavigationBar 的实例上设置外观.喜欢:

                The only way I can get it to work is to set the appearance on the instance of the UINavigationBar. Like:

                [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar-iphone.png"] forBarMetrics:UIBarMetricsDefault];
                

                发生了什么事?有其他人遇到过这个问题吗?

                What is going on? Has anyone else had this issue?

                推荐答案

                viewDidLoad 是搞乱导航控制器导航栏的 appearance 代理的错误位置.在创建导航控制器之前执行此类操作.在您的应用委托的 applicationDidFinishLaunching 中是一个好地方.

                viewDidLoad is the wrong place to be messing with the appearance proxy of a navigation controller's navigation bar. Do this sort of thing before the navigation controller is even created. In your app delegate's applicationDidFinishLaunching is a good place.

                这篇关于iOS 5 [UINavigationBar 外观] setBackgroundImage 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:UIBackButton背景图像未出现 下一篇:从弹出的 UINavigationController 或 UITabBarController 确定 viewWill

                相关文章

              • <legend id='KByiE'><style id='KByiE'><dir id='KByiE'><q id='KByiE'></q></dir></style></legend>
                • <bdo id='KByiE'></bdo><ul id='KByiE'></ul>

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

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