开发者

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?

UITableView with variable width cells

UITableView with variable width cells


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
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜