简体   繁体   English

子视图上的自动布局可防止调整整个窗口的大小

[英]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.

相关问题 为什么UIAlertView阻止显示我的模式视图控制器? - Why UIAlertView prevents my modal view controller from being displayed? 不使用自动布局调整UILabel的大小 - UILabel is not resized with autolayout ios自动布局-调整第一视图大小时移动第二视图 - ios Autolayout - move 2nd view when 1st view resized 模态视图可防止其他视图旋转 - Modal View prevents other views from rotating 在启动时显示窗口会阻止访问主表视图 - Showing a window at launch prevents access to main table view 如何防止 AutoLayout 重置视图框架? - How to prevent AutoLayout from resetting view frames? 以编程方式从视图中删除具有自动布局的UILabel - Programmatically remove UILabel that has autolayout from View 具有图像的“自动版式”按钮已调整为实际图像尺寸 - AutoLayout button with image is resized to actual image size 为什么将弱引用传递给块会阻止保留对象? - Why passing a weak reference to a block prevents an object from being retained? 除非以编程方式添加为子视图,否则不会显示从StoryBoard添加的UIActivityIndi​​catorView - UIActivityIndicatorView added from StoryBoard not being displayed unless added programmatically as a sub view
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM