Fuzej
Fuzej

Reputation: 97

How to add an image outside a uitableviewcell

Everywhere people are asking how to add an image inside an Uitableview. Well, I want the opposite, how can I make the cell shorter and add an image in front of it ? Just like the whatsapp-group-info-screen. (see image)

enter image description here

Upvotes: 2

Views: 270

Answers (2)

Mundi
Mundi

Reputation: 80271

The recommendation with the tableHeaderView is valid. But if you already create a view that looks like in image with a "cell" beside it (with the rounded corners of grouped table view), you could also use this view to subclass UITableViewCell and thus use this pattern anywhere in your table.

Upvotes: 1

Eugene
Eugene

Reputation: 10045

Use tableHeaderView property of UITableView for this purpose if header is the only place this image will appear. Simply create a UIView with the layout you need and set it as tableHeaderView of your tableView.

BTW, you might want to filter the content you're posting in your questions on stackoverflow in the future.

Upvotes: 5

Related Questions