I want to load a table vi开发者_运维技巧ew with cells. In between cells I should able to see minimum cell gap. How can I increase existing table view cell distance in my navigation controller root view?
You can't increase cell distance, but what you can do is subclass UITableViewCell, override -layoutSubviews
, and reposition all the internal views to allow for a bit of padding on one (or both) end(s) of the cell.
That said, I can't think of a single app on the iPhone that has a cell padding like this. You should think very carefully before doing this, as it's quite non-standard.
+1 you cant increase cell distance. However you can make it look that way: custom cells are easy to make in IB, and good custom cells are worth their weight in gold. You could set the cell spacer to none and a desired hight while making two UIImageViews (or a label with a cheeky string of underscores) in the cell to create the illusion of a cell boundary.
Here is a good tutorial on custom cells (I recommend watching the screen-cast): http://icodeblog.com/2009/05/24/custom-uitableviewcell-using-interface-builder/
精彩评论