开发者

Displaying a UITableView followed by an image, followed by more UITableViewCells

开发者 https://www.devze.com 2022-12-16 15:02 出处:网络
I\'ve seen some applications on the iPhone have an image on top of the tableView, which is straight forward and can be set with something like tableViewHeader.. and a picture below set with tableViewF

I've seen some applications on the iPhone have an image on top of the tableView, which is straight forward and can be set with something like tableViewHeader.. and a picture below set with tableViewFooter. I recently开发者_如何转开发 seen an application where there is an image in the header, a table view, then another image below the footer, and then subsequently a couple UITableViewCells...

Is there a straight forward way to accomplish this without using two UITableViews in the same controller?


Multiple sections will accomplish this, you can also use this method on your UITableViewDelegate

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;

in conjunction with a custom UITableView cell created in

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

This will allow you to specify a custom cell with the appropriate height that contains your image.


Use 2 sections.

0

精彩评论

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