在Xcode 11中无法等于Superview的高度 [英] Cannot equal height to Superview in Xcode 11

查看:151
本文介绍了在Xcode 11中无法等于Superview的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天将Xcode升级到11,只是意识到Xcode不允许我再创建从子视图到视图控制器的根视图的比例高度.直到今天早上,我都能使用以前的Xcode版本做到这一点.唯一的解决方法是向控制器添加另一个 sub root view (子根视图),然后将其下的所有内容移动.此选项将花费太多时间来重新设计控制器的设置.

I upgraded my Xcode today to 11 and just realised that Xcode doesn't allow me to create proportional height from a sub view to the view controller's root view anymore. I was able to do it till this morning with the previous Xcode version. The only workaround is to add another sub root view to the controller and move everything under it. This option will take too much time to re-design the setup the controller.

您遇到同样的问题吗?

这是来自新的Xcode11.您可以看到,不再有相等的高度或宽度选项可以进行超级视图.

This is from the new Xcode 11. As you can see there is no equal height or width option to superview anymore.

此图片来自我在其中一个Xcode中创建的约束视图中.如您所见,比例约束等于ViewController的超级视图,比率为0.65.

And this pic is from one of my Views that I created it's constraint in previous Xcode. As you can see there is a proportional constraint equals to the ViewController's superview with 0.65 ratio.

我不想在视图控制器中添加中根视图.这只是一个浪费时间的过程.有任何想法吗?我是否缺少新的魔术按钮或+?

I don't wanna add a mid root view to the view controller. It will be just a time wasting process. Any ideas? Am I missing a new magic button or +?

推荐答案

您可以将视图设置为等于安全区域.

You can set your view equal to the Safe Area.

如果仍然依赖于使其与根视图本身相等,则可以在 Attributes Inspector (属性检查器)中修改约束:

If you still rely on having it equal to the root view itself, you can modify the constraint in the Attributes Inspector:

这篇关于在Xcode 11中无法等于Superview的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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