ACBurk
ACBurk

Reputation: 4428

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 curious how they are dynamically resizing the cells and putting the image view in the UITableView. Is this some common trick/smoke-n-mirrors/workaround?

alt text alt text

Upvotes: 1

Views: 497

Answers (2)

AechoLiu
AechoLiu

Reputation: 18368

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

Upvotes: 0

MCannon
MCannon

Reputation: 4041

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

Upvotes: 3

Related Questions