简体   繁体   English

为什么它要求我提供 Y 位置或高度? 我该如何解决?

[英]Why is it asking me for a Y position or a height? How can I fix it?

This is a very basic question and I am just not being able to fix it.这是一个非常基本的问题,我只是无法解决它。

I am just trying to have two equal sized views on my scene.我只是想在我的场景中有两个大小相等的视图。 And I've set the constraints on both and having the:我已经对两者都设置了限制,并且具有:

  • vertical distance between them be 0它们之间的垂直距离为 0
  • Both leading and trailing set at 0 with the safe areas前导和尾随都设置为 0,安全区域
  • Top view align top to safe area顶视图将顶部对齐到安全区域
  • Bottom view align bottom to safe area底部视图将底部对齐到安全区域

I have attached two screenshots below showing what I have:我在下面附上了两个屏幕截图,显示了我所拥有的:

在此处输入图片说明

在此处输入图片说明

I have also attempted to set them to equal heights我也试图将它们设置为相等的高度

在此处输入图片说明

Here are the constraints you must add to both of your views.以下是您必须向两个视图添加的constraints

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何在目标C中的AVPlayerLayer中获得AVPlayer y的位置,高度,宽度 - How can i get AVPlayer y position, height, width in AVPlayerLayer in objective c 如何修复 TableViewCell position 不变? - How can I fix the TableViewCell position unchanged? 如何在iOS中为x,y,高度,宽度和旋转设置动画? - How can I animate x, y, height, width, and rotation in iOS? 为什么带有 UILabels 的嵌套 UIStackViews 需要 Y 位置和高度约束? - Why do nested UIStackViews with UILabels require Y position and height constraints? 如何获得UITextField相对于UIScreen的原点y位置? - How can I get UITextField origin y position relative to UIScreen? 如何快速更新y的文本输入位置,具体取决于键盘高度 - How do I update text input position of the y depending on keyboard height in swift 如何修复宽度、高度和变换的 ios 过渡? - How can I fix ios transition for width, height and transform? 如何获取当前的x和y位置以便我可以使用GCRectMake? - How do I get the current x and y position so that I can use GCRectMake? 如何在视图自动调整后获得CGRect值x,y,width,height? - How can i get CGRect values x,y,width,height after view is being autoresized? 我如何通过 x 和 y 轴以及屏幕的高度和宽度在 swift 中以编程方式截取屏幕截图 - How can i pass both x and y axis along with height and width of Screen to take screenshot programmatically in swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM