3

I have an image view that i would like to maintain the aspect ratio of but still be able to resize the window.

Maxwell Dergosits
  • 297
  • 1
  • 4
  • 12

2 Answers2

3

Set the image view scaling property to "proportionally up or down" in interface builder and set the content aspect ratio of the window containing it:

        [window setContentAspectRatio:myImageView.image.size];
dbainbridge
  • 1,190
  • 11
  • 18
0

As far as I know, there's no way to do this "automatically", you'll need to follow the frame change of the window (with the delegate method windowWillResize:toSize:) and adjust your image view's frame however you want it to change.

rdelmar
  • 103,982
  • 12
  • 207
  • 218