如何将UILabel与个人资料照片图像水平对齐? [英] How to align UILabel Horizontally with the profile photo image?

查看:84
本文介绍了如何将UILabel与个人资料照片图像水平对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须显示名称"和电子邮件ID"与个人资料图片"正确地水平对齐.这样,名称和电子邮件ID就会恰好出现在UIImageView的中心.

I have to show the Name and EmailID aligned horizontally properly with the Profile Image . So that the Name and email ID appears exactlybat the center of the UIImageView.

但是您可以看到姓名和电子邮件ID不在个人资料图像的中心.为什么会这样呢?我给出了以下限制条件:

But you can see the name and email id are not in centre with the profile image. Why is this happening? I have given the following constraints:

推荐答案

删除前导和尾随约束,并将中心x对齐到imageView.

Remove leading and trailing Constrain and set align center x to imageView.

您还可以设置前导约束和尾随约束.但两者都相等.

You can also set leading and trailing Constrain. but both are equal as follow.

这篇关于如何将UILabel与个人资料照片图像水平对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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