<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 暗淡背景 查看全屏

        时间:2023-06-12

        <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 暗淡背景 查看全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:通过视图控制器、标签栏控制器、导航控制器和视图控制器传递数据 下一篇:如何使用情节提要 ID 显示各种视图控制器(每个都有其各自的导航控制器)

                  相关文章

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

                      <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>

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