How to increase the UITableView separator height?

后端 未结 17 2169
花落未央
花落未央 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 00:59

    The easier and safest solution to this problem is to turn off the table separator and use a UITableViewCell as a separator of variable height. Sure, you'll have to do some index math to figure out where items are, but really it's odd / even.

    It won't break and you get the benefit of recyclable cells (no extraneous views to clean up).

提交回复
热议问题