nstoolbaritem 大小 OS X
nstoolbaritem size OS X
我和 swift 一起工作 osx,我有一个 nstoolbaritem。
这个工具栏项目太大了。
我想把它显示得小一些。
我试过这个:
@IBOutlet weak var toolbarItem: NSToolbarItem!
toolbarItem.maxSize = NSSize(width: 15, height: 15)
但工具栏项目图像的大小没有改变:(
maxSize
和 minSize
仅在您为工具栏使用自定义视图时适用。
即
toolbarItem.view = MyCustomControlView(frame: someRect)
AppKit
控件仅服从包含工具栏的 sizeMode
。
有关详细信息,请参阅 the documentation。
我和 swift 一起工作 osx,我有一个 nstoolbaritem。 这个工具栏项目太大了。
我想把它显示得小一些。 我试过这个:
@IBOutlet weak var toolbarItem: NSToolbarItem!
toolbarItem.maxSize = NSSize(width: 15, height: 15)
但工具栏项目图像的大小没有改变:(
maxSize
和 minSize
仅在您为工具栏使用自定义视图时适用。
即
toolbarItem.view = MyCustomControlView(frame: someRect)
AppKit
控件仅服从包含工具栏的 sizeMode
。
有关详细信息,请参阅 the documentation。