[英]Adding space between tableviewcell in Swift
我試圖在動態單元格之間添加空間。
那是我的代碼。 我不明白為什么它不起作用。
func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 50
}
func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let footer = UIView()
footer.backgroundColor = UIColor.clearColor()
return footer
}
您可以通過將section中的numberOfRows設置為1並將numberofSections設置為填充單元格的動態項數組來實現。 然后,您可以將頁腳視圖高度設置為所需的空間。
func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return YOUR_DESIRED_SPACE_BETWEEN_CELLS
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.