I have a custom tableViewCell with an imageView inside it. Layout as such:
I want to use autolayout to calculate height of the cell in method
CGSize size = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
so I set up constraints like this
Basically these constraints just pin each element to the edge of its superView or to the view above/below.
The problem is that there is one more constraint I want to add which is the imageView's aspect ratio. I want set imageView's height is always half of its width. If I directly set up aspect ratio constraint to 2:1 I always get Unable to simultaneously satisfy constraints
error. I tried change the priority to high and still no luck.
Can I achieve this by using autolayout?