带边距到边缘的表格swift2
我想构建这样一个视图: 上、左、右、下都有边距的桌子 我尝试以下代码:带边距到边缘的表格swift2,swift2,ios9,Swift2,Ios9,我想构建这样一个视图: 上、左、右、下都有边距的桌子 我尝试以下代码: self.EinstellungenTable.contentInset = UIEdgeInsets(top: 8, left: 8, bottom: 0, right: 8) 但结果将是: 有什么问题吗?您可以通过不同的方式实现此结果。这是几个选项,但这肯定可以通过使用不同的方法来实现 将表格视图添加到UIViewController的视图并设置边距 重写func viewDidLoad(){ super.view
self.EinstellungenTable.contentInset = UIEdgeInsets(top: 8, left: 8, bottom: 0, right: 8)
但结果将是:
有什么问题吗?您可以通过不同的方式实现此结果。这是几个选项,但这肯定可以通过使用不同的方法来实现
没有人知道解决办法吗?面向对象
let tableView = UITableView(frame: self.view.bounds.insetBy(dx: 8, dy: 8))
tableView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
self.view.addSubview(tableView)
.
.
.