开发者

I have a table view and I want to spread table cells with a gap

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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜