简体   繁体   English

如何在横向方向上设置垂直约束(故事板)

[英]How to set vertical constraints in landscape orientation (Storyboard)

I am trying to set a vertical space constraint of 8 between the "x" button and the bottom of the screen. 我正在尝试在“ x”按钮和屏幕底部之间设置8的垂直空间约束。 However it isn't working as expected. 但是,它没有按预期工作。

As you can see from the screen setting the constraint of -200 positions the "x" right there, and setting it to 8 would result it to be much higher up. 从屏幕上可以看到,将约束x限制在-200位置,将其设置为8会使它的高度更高。

I've attached a screenshot below. 我已经附上了下面的截图。 Why is the logic different from that of a portrait orientation? 为什么逻辑与纵向方向不同? And how do I correctly add the constraint? 以及如何正确添加约束?

垂直约束

Aside from the constant (which you explain is your problem) the constraint looks correct. 除了常量(您要解释的是问题)之外,约束看起来是正确的。 Make sure that you have constrained your item to the correct view. 确保已将项目约束到正确的视图。 If there is another container view in your scene it may be constrained to that by mistake. 如果场景中还有另一个容器视图,则可能会错误地将其限制为该视图。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM