views:

36

answers:

2

I want to load a table view 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?

+1  A: 

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.

Kevin Ballard
can u help me how to add image to navigation bar or add image inplace of that ...
lak in iphone
UIImage * buttonExampleImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"imageName"] ofType:@"png"]]; UIButton *buttonExmaple = [UIButton buttonWithType:UIButtonTypeCustom]; [buttonExmaple setImage:buttonExampleImage forState:UIControlStateNormal]; [buttonExmaple addTarget:self action:@selector(ButtonEvent:) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = buttonExmaple;
Luke Mcneice
A: 

+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/

Luke Mcneice