iOS 自动布局 : Align left edge of a UILabel with horizontal center in container?

标签 ios uitableview autolayout

所以我正在尝试创建一个如下所示的自定义 UITableViewCell:

See the second column of titles and how the left side of them are aligned with the center

我正在尝试让详细信息标签左对齐,并将标题标签上的内容设置得更高。

所以我面临的挑战是我希望标题单元格第二列的左边缘与整个 View 的中心对齐。

有办法吗?

最佳答案

尝试使用几个分组 View ,每列一个。将每个列 View 的外边缘固定到单元格内容 View 的边缘,然后向列 View 添加等宽约束。

一旦包含列 View 就位,您就可以在每个列 View 中布置标签。

enter image description here

enter image description here

关于iOS 自动布局 : Align left edge of a UILabel with horizontal center in container?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19938878/

相关文章:

ios - AppStore API Call URL 的参数有哪些?

ios - 在 swift NSObject 子类中使用 CoreFoundation 对象时出现运行时错误

ios - 快速行插入 UITableView 会导致 NSInternalInconsistencyException

ios - 如何将约束转换为 VFL

ios - 自动布局:具有可变高度和两个标签的表格单元格

ios - 当不存在单元格时,如何向 UITableViewController 添加不同的默认背景?

ios - 如何处理 facebook 对话框请求的取消按钮?

iOS 11 刷新控件 + 搜索栏 = 刷新时缺少微调器

ios - UIPageViewController 在访问 UITableView 内容后不加载页面内容

iphone - Xcode 5 自动布局 : collection of views inside another view