简体   繁体   English

设置宽度和高度约束时,UIImageView将位于单元格的左上方。

[英]UIImageView going to top left of cell when setting width and height constraints.

在此处输入图片说明

I'm setting 50 / 50 for width and height and trying to set it ten from the top and ten from the left side, but when I run the app the view gets pushed all the way to the top left. 我将宽度和高度设置为50/50,并尝试将其从顶部设置为10,从左侧设置为10,但是当我运行该应用程序时,视图会一直推到左上方。

I've completely removed all restraints and started from scratch on the tableview, and it's still a problem. 我已经完全删除了所有限制,并从头开始在tableview上,这仍然是一个问题。

Never had this problem before, any ideas? 以前从未遇到过这个问题,有什么想法吗?

While set constraint to any UIController uncheck "checkbox constraint to margin" display in Image and then set constraint and try again. 将约束设置为任何UIController时,取消选中Image中显示的“复选框约束到边距”,然后设置约束并重试。 May it will help you. 愿它能对您有帮助。 在此处输入图片说明

暂无
暂无

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

相关问题 UIImageView 忽略宽度/高度约束 - UIImageView ignores the width/height constraints UIImageView高度不是自动布局约束后子图像高度的高度。 - UIImageView height not height of child image's height after autolayout constraints. 在运行时更改元素的左,上,宽和高约束 - Changing element left, top, width and height constraints at runtime 为集合视图单元格设置自动布局宽度和高度限制的最佳做法? - Best practices for setting autolayout width and height constraints for a collection view cell? UIImageView创建额外的宽度/高度约束 - UIImageView creates extra width/height constraints 在旋转时更新高度约束时收到“无法同时满足约束条件”警告 - Getting “Unable to simultaneously satisfy constraints.” warning when updating height constraint at rotation 将UIImageView引脚固定到其Superview的顶部,左侧,右侧,底部,等宽和等高的编程方式是什么? - What's the programmatic way to make a UIImageView pin to it's superview's top, left, right, bottom, equal width, and equal height? 为什么右、左、宽、高不能在 UIImageView 上工作? - why won't right, left, width, height work on UIImageView? 更改高度时按比例调整UIImageView的宽度 - adjusting the width of UIImageView proportionally when changing height 当我们使用不同大小和类型的屏幕时,如何在iOS中设置UI控件的宽度和高度限制? - How setting width and height constraints of UI controls in iOS works when we use different size and types of screen?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM