美文网首页
UITableViewCell的LayoutMargin

UITableViewCell的LayoutMargin

作者: HoooChan | 来源:发表于2019-03-18 19:48 被阅读0次

但我们创建一个UITableView的时候,会发现分割线有一个默认的Margin:


那我们在ContentView里面自定义的视图要如何与这个Margin对齐呢?

1、选择contentView,然后到右侧Size Inspector面板勾选Preserve Superview Margins;

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

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

UITableViewCell with autolayout left margin different on iPhone and iPad

相关文章

网友评论

      本文标题:UITableViewCell的LayoutMargin

      本文链接:https://www.haomeiwen.com/subject/yuabmqtx.html