How to make the image in a tablecell the full width and dynamic height?

Can't figure out how to correctly do the following:
In table view, make the cell. Top cell TextLabel goes the full width, then Image the full width and after pictures description, just the full width.

The problem is that I can not understand how to make Image stretch height without breaking is proportional to the picture.

As far as I understand, all depends on the height of the cell.

How to make such cell?
July 9th 19 at 10:52
2 answers
July 9th 19 at 10:54
If I understand you correctly it is done like this
Do you have a model which is the picture and its dimensions(simmered server throws)
In a method height Fort ditch to get the size and find
Well, if the picture is big and it shrunk in width, then the height of the original is not correct. - Maggie18 commented on July 9th 19 at 10:57
you need to consider
you have davisa width, width and height of the picture
Unknown height by your width
The usual krestikom consider - santina44 commented on July 9th 19 at 11:00
July 9th 19 at 10:56
You need to strictly define costraint in the cell it to be attached to the top, bottom, left, right and insert the two lines in the viewDidLoad in the controller with table view:

self.tableView.rowHeight = UITableViewAutomaticDimension;
 self.tableView.estimatedRowHeight = 80.0;

In setting the rowHeight, you can put any value, the main thing that it was not empty, and preferably close to the approximate height of the cells.

Find more questions by tags iOS