3

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

4

2 回答 2

3

在界面生成器中将图像视图缩放属性设置为“按比例向上或向下”,并设置包含它的窗口的内容纵横比:

        [window setContentAspectRatio:myImageView.image.size];
于 2013-07-15T15:41:35.030 回答
0

据我所知,没有办法“自动”执行此操作,您需要跟随窗口的框架更改(使用委托方法 windowWillResize:toSize:) 并调整您的图像视图的框架,但是您希望它改变.

于 2012-05-09T15:11:04.823 回答