UITableView with variable width cells
I'm curious how applications create this look, specifically the photo section and the 'skinnier' UITableViewCells. I haven't seen a delegate method for cell width so I'm curiou开发者_如何学编程s how they are dynamically resizing the cells and putting the image view in the UITableView. Is this some common trick/smoke-n-mirrors/workaround?
if i were to guess, i would say that they have added a UIView with a transparent background, which has a UIImageView for the photo, and a tableView as a subView
UITableView
|-header UIView
| |-UIImageView
| |-UITableView
|
|-tableViewContents
UITableView has two properties named tableHeaderView and tableFooterView, you can add custom UIView or UIView subclasses for these properties.
@property(nonatomic, retain) UIView *tableHeaderView
@property(nonatomic, retain) UIView *tableFooterView
精彩评论