开发者

Implementing "add photo" button similar to the iPhone contacts app

I was curious if anybody knew the process to create an "add photo" image tile similar to that in the iPhone contacts app. It seems to 开发者_C百科be on the same level as a UITableViewCell which is shortened (if this is the way it is done).

I've read a suggestion dealing with Headers or custom UITableViewCells but nothing definitive on how it was done. Any illustrative code snippets would be most welcome.

Thank you for any replies.


It's just a UIButton added to a UITableViewCell. You can simply use the addSubview method of the UITableViewCell to add a button to the cell.


It is a header. Most of the functionality is in the 'HeaderFooter' example from the apple developer site. In that example they use a UIImageView for the photo area, but you can implement it with a UIButton instead. If you do this, just set the text to 'Add Photo' when desired, with a blue bold font of about size 12. If you want to leave it as an imageView, you'll have to put a subview with the text on top of it.


The name part can easily be recreated with a UIButton with a PNG image of a detail disclosure icon set as the button Image. It really looks like a small UITabelViewCell.

If you really want you can use a tiny UITableViewCell instead of the PNG for to render the detail disclosure icon, but that's a heavier, more kludgy solution.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜