如何为调整大小的窗口维护纵横比?

时间:2022-01-06 05:11:18

I have a window that contains one QTMovieView. How do I make it so that resizing of the window will keep the window's aspect ratio the same?

我有一个包含一个QTMovieView的窗口。如何使窗口的大小保持不变?

1 个解决方案

#1


6  

[window setContentAspectRatio:NSMakeSize(width, height)]

More info: Apple's documentation, NSWindow class reference

更多信息:苹果的文档,NSWindow类参考

#1


6  

[window setContentAspectRatio:NSMakeSize(width, height)]

More info: Apple's documentation, NSWindow class reference

更多信息:苹果的文档,NSWindow类参考