0

According to my previous question. Autolayout for Height working in iOS8 but not working in iOS7

I use UIImageView which will display the image from server once the download finished. I have autolayout constraint to define the height of UIImageView which I set via IB and has an outlet.

In my code, when I finished download the image I change the height of autolayout to match the height of my image. It works perfectly in iOS8 but in iOS7 which I tested via simulator always display the UIImageView height bigger than image size make the vertical area of top and bottom blank Please see the screenshot here

enter image description here

I totally don't understand. I didn't get any warning but the autolayout just didn't work to keep the UIImageView height in place to what I set it via [layoutConstraint setConstant:]

Please help

Community
  • 1
  • 1
Kong Hantrakool
  • 1,865
  • 3
  • 20
  • 35

1 Answers1

0

In your other question you set the image view's content mode to "centre".

Try setting it to "Aspect Fill" or "Scale to Fill" according to what you need to achieve.

joakim
  • 3,533
  • 2
  • 23
  • 28