How to increase the UITableView separator height?

后端 未结 17 2213
花落未央
花落未央 2020-12-08 00:19

I want more space(10px) between each cell. How can I do this?

And I have added this code

tableView.separatorStyle = UITableViewCellSepar         


        
17条回答
  •  孤城傲影
    2020-12-08 01:02

    This is the easiest solution I've found:

    override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        " "
    }
    

    then just set the height to whatever you want:

    tableView.sectionHeaderHeight = 30.0
    

提交回复
热议问题