简体   繁体   中英

nstoolbaritem size OS X

i working with swift for osx and I have a nstoolbaritem. this toolbar item is to large.

i would like to show it smaller. i tried this:

@IBOutlet weak var toolbarItem: NSToolbarItem!
toolbarItem.maxSize = NSSize(width: 15, height: 15)

but the size of the toolbar item image does not changed :(

maxSize and minSize only apply when you are using custom views for your toolbar.

ie

toolbarItem.view = MyCustomControlView(frame: someRect)

AppKit controls only obey the sizeMode of the containing toolbar.

See the documentation for more details.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM