[英]Autolayout on a sub view prevents the whole window from being resized
I have a simple view with a few labels, textfields and a big NSTextField that spans across the remaining interface. 我有一个简单的视图,其中包含一些标签,文本字段和一个跨越其余接口的大NSTextField 。
I can setup auto layout so that the text field spans over the width of the window, but as soon as I add the last contraint Bottom space to container to its super view the window can no longer be resized. 我可以设置自动布局,以使文本字段跨过窗口的宽度,但是一旦我将最后一个约束底部空间添加到容器的超级视图中,就无法再调整窗口的大小。
These are my constraints: 这些是我的约束:
So currently I have to omit this constraint and I end up with the following result: 因此,当前我必须忽略此约束,最终得到以下结果:
See Screenshot 见截图
You need to fiddle with priorities on the constraints. 您需要摆弄约束的优先级。 Especially consider doing this on the height constraint. 尤其要考虑在高度限制下执行此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.