Swift nstoolbaritem大小OS X
我和斯威夫特一起为osx工作,我有一个nstoolbaritem。 此工具栏项太大 我想把它缩小一点。 我试过这个:Swift nstoolbaritem大小OS X,swift,macos,cocoa,toolbar,Swift,Macos,Cocoa,Toolbar,我和斯威夫特一起为osx工作,我有一个nstoolbaritem。 此工具栏项太大 我想把它缩小一点。 我试过这个: @IBOutlet weak var toolbarItem: NSToolbarItem! toolbarItem.maxSize = NSSize(width: 15, height: 15) 但是工具栏项目图像的大小没有改变:仅当您使用工具栏的自定义视图时,maxSize和minSize才适用 i、 e toolbarItem.view=MyCustomControlVi
@IBOutlet weak var toolbarItem: NSToolbarItem!
toolbarItem.maxSize = NSSize(width: 15, height: 15)
但是工具栏项目图像的大小没有改变:仅当您使用工具栏的自定义视图时,maxSize和minSize才适用
i、 e
toolbarItem.view=MyCustomControlViewframe:someRect
AppKit控件仅服从包含工具栏的sizeMode
有关详细信息,请参阅。小星号:由于NSToolbar的实现方式,当工具栏大小模式更改时,只有覆盖NSControl的controlSize的控件才会更新。