最佳答案
听起来您可能只想设置窗口的 contentAspectRatio
。
如果您需要更多控制,请参阅 Window Programming Guide 的摘录:
Additionally, when a window is about to be resized, the window’s delegate will be sent a
windowWillResize:toSize:
message. You can implement that method in your delegate to easily control your window’s size.
关于macos - cocoa - 如何调整一个方向的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13042518/