thu*_*hus 11 xcode constraints autolayout
我今天将Xcode升级到11,才意识到Xcode不允许我再创建从子视图到视图控制器根视图的比例高度。直到今天早上,我都能使用以前的Xcode版本做到这一点。唯一的解决方法是将另一个子根视图添加到控制器,然后将其下的所有内容移动。此选项将花费太多时间来重新设计控制器的设置。
您是否遇到相同的问题?
这来自新的Xcode11。您可以看到,不再有相等的高度或宽度选项可以进行超级视图。
这张图片来自我在以前的Xcode中创建的约束之一。如您所见,有一个比例约束等于0.65比率的ViewController的超级视图。
我不想在视图控制器中添加中间根视图。这只是一个浪费时间的过程。有任何想法吗?我是否缺少新的魔术按钮或+?
I have sent a bug report to Apple yesterday and also found the following discussion in Apple forums. I don't think I am the only developer experiencing this issue.
Xcode 11 Add "Equal Width to Superview" Constraint?
I am sure Apple will create a patch for this problem soon. So I decided to create a temporary solution by adding a new UIView named "Propotional View Helper" right under the root view. I gave trailing, leading, bottom and top constraints to its superview. Now I a able to drag to make equal width & height constraints to the superview.
| 归档时间: |
|
| 查看次数: |
1308 次 |
| 最近记录: |