1. <legend id='j3kvd'><style id='j3kvd'><dir id='j3kvd'><q id='j3kvd'></q></dir></style></legend>

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

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

      UINavigationController - 在所有视图中保留背景图像

      UINavigationController - Keep Background Image Across All Views(UINavigationController - 在所有视图中保留背景图像)
    4. <i id='kJUyT'><tr id='kJUyT'><dt id='kJUyT'><q id='kJUyT'><span id='kJUyT'><b id='kJUyT'><form id='kJUyT'><ins id='kJUyT'></ins><ul id='kJUyT'></ul><sub id='kJUyT'></sub></form><legend id='kJUyT'></legend><bdo id='kJUyT'><pre id='kJUyT'><center id='kJUyT'></center></pre></bdo></b><th id='kJUyT'></th></span></q></dt></tr></i><div id='kJUyT'><tfoot id='kJUyT'></tfoot><dl id='kJUyT'><fieldset id='kJUyT'></fieldset></dl></div>
        <bdo id='kJUyT'></bdo><ul id='kJUyT'></ul>

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

                <tfoot id='kJUyT'></tfoot>
                <legend id='kJUyT'><style id='kJUyT'><dir id='kJUyT'><q id='kJUyT'></q></dir></style></legend>
                  <tbody id='kJUyT'></tbody>

                本文介绍了UINavigationController - 在所有视图中保留背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                有没有办法让背景图像在导航控制器的所有视图中保持不变?目前我在每个视图的 viewDidLoad 方法中加载相同的背景,但这显示了在视图之间导航时背景图像移动.我宁愿只是背景幻灯片"开/关屏幕的视图 infront 的内容,但背景保持静止.这是我当前的背景图片加载代码:

                Is there a way to have a background image remain constant across all views in a navigation controller? Currently I am loading the same background in each view's viewDidLoad method but this shows the background image move when navigating from view to view. I'd rather just the content of the view infront of the background "slide" on/off screen, but the background stay stationary. This is my current background image loading code:

                UIImageView *background = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
                background.image = [UIImage imageNamed:@"InfoBackground.png"];
                [self.view addSubview:background];
                [self.view sendSubviewToBack:background];
                [background release];
                

                谢谢!

                推荐答案

                嗯,也许你看看 文档(向下滚动到图 2)您将了解您正在处理的内容.因为您正在为每个被推送到 UINavigationController 的视图控制器设置背景图像,所以您将获得该动画.您需要做的是将背景图像设置到导航控制器本身.

                Hm, perhaps if you look at the documentation (scroll down to Figure 2) you will get an idea of what you're dealing with. Because you are setting the background image for each of your view controllers that are being pushed into the UINavigationController, you will get that animation. What you need to do is set the background image into the nav controller itself.

                我相信 myNavController.view insertSubview:myImageView atIndex:0 应该可以工作.如果您的图像需要准确地填充在内容视图后面,您可以根据导航栏和工具栏的坐标和/或高度设置框架坐标,可以通过导航控制器的属性访问.如果没有,只需将框架设置为超级视图的边界即可.

                I believe myNavController.view insertSubview:myImageView atIndex:0 should work. If your image needs to fill in behind the content view exactly, you could set the frame coordinates based on the coordinates and/or heights of the navbar and toolbar, which can be accessed through the navigation controller's properties. If not, just set the frame to the superview's bounds.

                告诉我进展如何.

                哦,请注意,您需要确保每个视图控制器都有透明背景.

                Oh, note that you would need to make sure each of your view controllers had transparent backgrounds.

                这篇关于UINavigationController - 在所有视图中保留背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                How to get the previous viewcontroller that pushed my current view(如何获取推送我当前视图的上一个视图控制器)
                The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                  <bdo id='26Dx6'></bdo><ul id='26Dx6'></ul>
                • <i id='26Dx6'><tr id='26Dx6'><dt id='26Dx6'><q id='26Dx6'><span id='26Dx6'><b id='26Dx6'><form id='26Dx6'><ins id='26Dx6'></ins><ul id='26Dx6'></ul><sub id='26Dx6'></sub></form><legend id='26Dx6'></legend><bdo id='26Dx6'><pre id='26Dx6'><center id='26Dx6'></center></pre></bdo></b><th id='26Dx6'></th></span></q></dt></tr></i><div id='26Dx6'><tfoot id='26Dx6'></tfoot><dl id='26Dx6'><fieldset id='26Dx6'></fieldset></dl></div>
                • <tfoot id='26Dx6'></tfoot>

                    1. <legend id='26Dx6'><style id='26Dx6'><dir id='26Dx6'><q id='26Dx6'></q></dir></style></legend>
                        <tbody id='26Dx6'></tbody>

                        • <small id='26Dx6'></small><noframes id='26Dx6'>