自动布局和在通话状态栏 [英] Auto Layout and in-call status bar

查看:151
本文介绍了自动布局和在通话状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想请教一下自动布局,并在通话状态栏。以下是一个演示我的问题一个简单的场景:

I'd like to ask about Auto Layout and in-call status bar. Here's a simple scenario that demonstrates my problem:


  1. 与使用故事板已启用创建项目

  2. 添加查看控制器,并启用其在初始视图控制器

  3. 控制器的视图的设置背景颜色为红色

  4. 添加表视图到控制器的视图

表视图应该有4个布局限制(领先,顶部,后,底部)恒定设置为上海华为0。

The table view should have 4 layout constraints (leading, top, trailing, bottom) to Superview with constant set to 0.

现在当我运行此应用程序在模拟器和preSS <大骨节病>⌘ + <大骨节病> T 我可以看到红色的背景,而在通话状态栏的动画。它是可能摆脱这种故障呢?

Now when I run this app in Simulator and press + T I can see red background while the in-call status bar animates in. Is it possible to get rid of this glitch?

推荐答案

(使用的答案,而不是评论由于缺乏声誉,对不起。)

(Using answer instead of comment due to lack of reputation, sorry.)

我就遇到了这个问题,也是并被例如尝试该解决方案指出,上面:它没有为我工作

I ran into this issue as well and was trying out e.g. the solution pointed out above: It didn't work for me.

所以我创造了例如​​code的仓库,露出原来的海报的问题。有应用实例这些方案:

So I created a repository with example code to expose the original poster's problem. There are example applications for these scenarios:


  1. 自定义视图控制器窗口的根视图控制器,

  2. 自定义视图控制器是一个UINavigationController这是窗口的根视图控制器,
  3. 的子
  4. 自定义视图控制器是一个的UITabBarController是窗口的根视图控制器和一个孩子

  5. 自定义视图控制器是一个UINavigationController这是作为一个的UITabBarController是窗口的根视图控制器的孩子的孩子。

原来,从CEarwood的解决方案的实际工作......当自定义视图控制器是一个UINavigationController的孩子(例2和4)。 Hoewever,它不会在例1和3的工作

It turned out that the solution from CEarwood actually works… when the custom view controller is a child of a UINavigationController (cases 2 and 4). Hoewever, it does not work in cases 1 and 3.

我希望这个信息是有用的。

I hope this information is useful.

这篇关于自动布局和在通话状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆