【发布时间】:2017-04-15 07:35:31
【问题描述】:
我想在UITableView 中的单元格之间添加空格。
这是我的代码。我的意思是细胞然后空间然后细胞然后空间等等。
class TableViewController: UITableViewController {
var textArray = [String]()
var cellsArray = ["1","2","3"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
textArray = ["","",""]
self.tableView.estimatedSectionHeaderHeight = 80
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return textArray.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: (cellsArray[indexPath.row]), for: indexPath) as UITableViewCell
return cell
}
}
【问题讨论】:
-
添加表格后视图。 @Q8i 代码
标签: ios swift uitableview