How to add spacing between UITableViewCell
ios, objective-c, uitableview
Solution
My easy solution using Swift :
// Inside UITableViewCell subclass
override func layoutSubviews() {
super.layoutSubviews()
contentView.frame = contentView.frame.inset(by: UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10))
}
Result
Problem
Is there any way to add spacing between `UITableViewCell`? I have created a table and each cell only contain an image. The image is assigned to the cell like this: ``` cell.imageView.image = [myImages objectAtIndex:indexPath.row]; ``` but this make the image enlarged and fit into the whole cell, and there are no spacing between the images. Or lets say in this way, the height of image are e.g. 50, and I want to add 20 spacing between the images. Is there any way to accomplish this?