如何使用Objective-C库在OS X中设置窗口的最大和最小大小?
[theWindow setMaxSize:windowMaxSize];
[theWindow setMinSize:windowMinSize];
In Swift 2 this would be:
myWindow.contentMinSize = NSSize(width: 600, height: 500)
myWindow.contentMaxSize = NSSize(width: 1024, height: 780)
Also according to the Apple docs, contentMinSize takes precedent over setMaxSize.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.