UITableViewCell的LayoutMargin
2019-03-18 本文已影响0人
HoooChan
但我们创建一个UITableView的时候,会发现分割线有一个默认的Margin:

那我们在ContentView里面自定义的视图要如何与这个Margin对齐呢?
1、选择contentView
,然后到右侧Size Inspector
面板勾选Preserve Superview Margins
;

2、选中cell
,同样勾选Preserve Superview Margins
;

3、选中需要布局的子视图,双击约束进入以下面板,勾选Relative to margin
:

