Frenck
Frenck

Reputation: 6534

How to make a stretchable custom UITablecell

What is the best way to create a stretchable UITableViewCell? So for example i want to create a custom UITableViewCell (I already know how) but I don't now how I can create a custom stretchable border around the image

For example something like:

So the images got a different size of height (width is the same)

Upvotes: 0

Views: 67

Answers (1)

Timur Mustafaev
Timur Mustafaev

Reputation: 4929

You need to use tableView:heightForRowAtIndexPath: method. It allows you to set height for each row. Just get height of your image and return it in tableView:heightForRowAtIndexPath: method.

If you want to make same thing as on your image above, you should also set margins for UIImageView and disable row separators in Interface Builder

Upvotes: 2

Related Questions