Reputation: 410
I have set my tableView's background color, and I want there is space(10px) around each cell show that color.
e.g.(ignore the red line)
What I am doing now is make the cell embed a smaller view, and set the cell's background to be clear. But it is annoying to create such embed view again and again.
So, I am seeking for a better solution, I believe it would be good if i can increase separator's height. But the old answers did not solve my problem.
(How to increase the UITableView separator height?)
EDIT:
However, if I add my own separator in cell. I may not able to set the cell having round corner
Upvotes: 1
Views: 751
Reputation: 13893
tableView
's separatorStyle
to .None
.UITableViewCell
subclass.subview.layer.cornerRadius = 10.0
, subview.layer.masksToBounds = true
).You don't have to use the cell repeatedly in InterfaceBuilder. Just give the cell an ID, and in your implementation of the table view's data source, dequeue a cell instance using that ID and set the values of the labels inside it.
Upvotes: 2
Reputation: 3519
Have you thought of just making the cell height taller and putting your own separator on the bottom of your custom cells? Nice table layout by the way.
Upvotes: 1