views:

446

answers:

3

Hi,

When you add a new contact, the first row contains the add photo button and the x co-ordinate of start of the cell is set to some value which is greater than the rest of the cells. How can this photo button be added and the cell frame can be changed?

Thanks!

+4  A: 

They use a custom cell to achieve this. This custom cell has the picture-like control on the left and mimics a table cell next to it. It's not something that comes out of the box.

You can't set the x co-ordinate of a cell either, you can set the indendation on the other hand.

Edit: come to think about it, they probably use a custom table header instead of a custom cell. You certainly will find the headerfooter sample on developer.apple.com helpful.

Link: http://devworld.apple.com/iphone/library/samplecode/HeaderFooter/index.html

Yannick Compernol
A: 

I am more inclined to believe that they use tableHeaderView property.

Sure you can achieve the effect with custom cell. But with header its pretty simple! I have done the same in few places!

Prakash
A: 

Would you please tell me how you achieved the effect.

If I add a cell to the header ,how to handle the message when didselectrowatIndexPath?

thanks in advance...

xia