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

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

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

      1. <tfoot id='JzBdP'></tfoot>
          <bdo id='JzBdP'></bdo><ul id='JzBdP'></ul>

        iOS 暗淡背景 查看全屏

        iOS dim background View full screen(iOS 暗淡背景 查看全屏)

        <small id='7ihfP'></small><noframes id='7ihfP'>

        <legend id='7ihfP'><style id='7ihfP'><dir id='7ihfP'><q id='7ihfP'></q></dir></style></legend>
          <tbody id='7ihfP'></tbody>
        • <bdo id='7ihfP'></bdo><ul id='7ihfP'></ul>

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

                  本文介绍了iOS 暗淡背景 查看全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的问题应该很简单,但我找不到解决方案.

                  My question should be simple but I couldn't find solution.

                  我正在显示模态 VC,我想添加暗淡的背景视图.

                  I am displaying modal VC and I want to append dim background view.

                  Modal VC 作为子 VC 添加到父 VC.父 VC 放置在 Navigation Controller 的顶部 (topViewController)

                  Modal VC is added as a child to the parent VC. Parent VC is placed at top of Navigation Controller (topViewController)

                  Dim 视图被添加到 UIScreen.windows.first! 窗口.但是昏暗的视图并没有填满整个屏幕.我确实使用 CGPointZero 为它设置了框架,我尝试了负 y 值它没有帮助.它看起来像这样.我还添加了一组自动布局约束,设置为 false/true translatesAutoresizingMaskIntoConstraints 属性,更改了 clipToBounds.

                  Dim view is added to the UIScreen.windows.first! window. But the dim view doesn't fill the whole screen. I do set frame for it with CGPointZero for origin, I tried negative y value it didn't help. It just look like this. Also I added set of auto layout constraints, set to false/true translatesAutoresizingMaskIntoConstraints property, changed clipToBounds.

                  没什么用,昏暗的视图不会覆盖整个屏幕.

                  Nothing helps, the dim view doesn't cover entire screen.

                  我可以全屏显示dim view,如果我不添加modal VC作为孩子,即我直接利用modal VC的视图,并将其添加到窗口.它看起来不错,但还有另一个错误.这就是为什么我要添加模态 VC 作为子 VC.如何强制昏暗视图显示整个屏幕.

                  I can display the dim view in full screen, if I don't add modal VC as a child, i.e. I directly utilize modal VC's view, and add it to the window. It looks fine, but there is another bug. That's why I am adding modal VC, as a child VC. How to force dim view display the whole screen.

                  在应用程序中可能同时显示多个模态 VC,这就是为什么 seques(即 VC 的呈现)不是最佳选择的原因.

                  In the app there might be several modal VC displayed simultaneously, that's why seques, (i.e presentation of VCs) is not the best choice.

                  附:这是错误的描述:

                  .如果将模态VC(放置在Nav.Controller中的UITableVC)的视图直接添加到窗口中,视图在从BG返回后显示移位的表格,即在BG中并开始从BG显示模态VC的情况下,之后切换回前台,表格标题的一部分(问题显示部分)向上移动并且模态VC的导航栏被展开,即它们相交,表格的标题没有完全显示.我无法解决这个问题.

                  . In case of adding modal VC (UITableVC placed into Nav. Controller)'s view directly to the window , view displays shifted table, after returning back from BG, i.e. in case of being in BG and starting to display modal VC from BG, after that switching back to Foreground, part of table's header (Question is revealed part) is shifted up and modal VC's navigation bar is expanded, i.e. they intersect, header of the table isn't display completely. I couldn't fix that.

                  推荐答案

                  把你的视图放在导航控制器的视图下:

                  Put your view under navigation controller's view:

                  UIView *dimView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
                  dimView.backgroundColor = [UIColor colorWithWhite:.4f alpha:.5f];
                  [self.navigationController.view addSubview:dimView];
                  [self.navigationController.view bringSubviewToFront:dimView];
                  

                  这篇关于iOS 暗淡背景 查看全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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设置灯光状态栏文字颜色的正确方法)
                1. <legend id='2oXxE'><style id='2oXxE'><dir id='2oXxE'><q id='2oXxE'></q></dir></style></legend>
                    <tbody id='2oXxE'></tbody>

                        <bdo id='2oXxE'></bdo><ul id='2oXxE'></ul>

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

                            <small id='2oXxE'></small><noframes id='2oXxE'>