nstoolbaritem大小OS X
问题描述:
我使用swift处理osx,并且我有一个nstoolbaritem。 这个工具栏项目要大。nstoolbaritem大小OS X
我想展示它更小。 我想这:
@IBOutlet weak var toolbarItem: NSToolbarItem!
toolbarItem.maxSize = NSSize(width: 15, height: 15)
但工具栏项目上的图像的大小不会改变:(
答
maxSize
和minSize
只有当你正在使用您的工具栏自定义视图应用
即
。toolbarItem.view = MyCustomControlView(frame: someRect)
AppKit
con trols只服从包含工具栏的sizeMode
。
有关更多详细信息,请参阅the documentation。