I want more space(10px) between each cell
. How can I do this?
And I have added this code
tableView.separatorStyle = UITableViewCellSepar
In Swift
The easiest and shortest way for me was to add the snippet below in cellForRowAtIndexPath
or in willDisplayCell
:
override func tableView(tableView: UITableView,
willDisplayCell cell: UITableViewCell,
forRowAtIndexPath indexPath: NSIndexPath)
{
let additionalSeparatorThickness = CGFloat(3)
let additionalSeparator = UIView(frame: CGRectMake(0,
cell.frame.size.height - additionalSeparatorThickness,
cell.frame.size.width,
additionalSeparatorThickness))
additionalSeparator.backgroundColor = UIColor.redColor()
cell.addSubview(additionalSeparator)
}