【发布时间】:2020-09-12 07:38:39
【问题描述】:
我将单元格添加到表格中并使用 xib 制作它们。现在它们是桌子的整个宽度。 How can I add indentation on the right and left for these cells? 我尝试了以下代码,但没有帮助。
override func awakeFromNib() {
super.awakeFromNib()
contentView.frame = frame.inset(by: UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10))
}
【问题讨论】:
-
您可以在 xib 中添加自动布局约束。
标签: ios swift uitableview cell padding