Reputation: 307
I have an image view that i would like to maintain the aspect ratio of but still be able to resize the window.
Upvotes: 3
Views: 1113
Reputation: 1202
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];
Upvotes: 3
Reputation: 104082
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.
Upvotes: 0