与图像视图一排自动布局问题 [英] Auto layout issue with a row of image views

查看:133
本文介绍了与图像视图一排自动布局问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我发疯!

我试图表现出的追随者图像的排在我的应用程序的配置文件。我们的想法是为它是5张图片,你可以在理论上点击它们,并转移到他们的个人资料。

I am trying to show a row of images of followers to a profile in my app. The idea is for it to be 5 images where you could theoretically click on them and move to their profile.

下面是我有现在的烦恼:

Here is what I am having troubles with now :

自动布局地狱

我从来没有询问有关汽车的布局之前,所以我不知道是什么,并列出所有的帮助。是感觉这是一个愚蠢的问题...

I've never had to ask about auto layout before so I don't know what to show you all for your help. Is feel like this is a silly problem...

下面是安装程序:


  • 设计在一个单独的厦门国际银行

  • 所有元素都封装在一个UITableViewCell

任何帮助将是AP preciated。

Any help would be appreciated.

编辑:因此,按米哈尔我尝试了堆栈视图,虽然它似乎是正确的事情做老老实实地给了我同样的结果,所以我相信我这样做是错误的。请参阅下图

在这里输入的形象描述

推荐答案

我想我会做这一个答案,这样的意见不要太长时间。所以,一切这些都是你应该已经添加了约束:

I figured I would make this an answer so that the comments don't get too long. So, with everything these are the constraints you should have added:

1)将所有的UIImageView的有平等的宽度

1) Set all UIImageView's to have equal widths

2)将所有的UIImageView的纵横比限制

2) Set all UIImageView's aspect ratio constraint

3)高度约束添加到每个UIImageView的

3) Add a height constraint to each UIImageView

4)将所有的UIImageView的有平等的高度,就像在步长1

4) Set all UIImageView's to have equal heights, just like with width in step 1

5)各设置的UIImageView前缘和后空间的限制。这一个是有点棘手。第一个的UIImageView应该有一个领先的约束= X。最后的UIImageView应该有一个尾随约束= X。每间UIImageView的约束应该是> = X。

5) Set leading and trailing space constraints for each UIImageView. This one is a little tricky. The first UIImageView should have a leading constraint = x. The last UIImageView should have a trailing constraint = x. The constraints between each UIImageView should be >= x.

这是选择约束的图标:

在这里输入的形象描述

这篇关于与图像视图一排自动布局问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆