I want to have a unified toolbar and therefore I found this post:
How can I create Yosemite-style unified toolbar in Interface Builder?
self.window.titleVisibility = NSWindowTitleVisibility.Hidden
works perfect.
But is there a way to change the background color for the toolbar? I tried with self.window.appearance = NSAppearance(named: NSAppearanceNameVibrantDark)
, but this only brings a complete black toolbar (that's too dark). I want to have a custom color.
This one works:
https://stackoverflow.com/a/28692893/2062613
Set the window to textured in IB (I don't see a possibility to do it at runtime)
Use this code:
self.window.titleVisibility = NSWindowTitleVisibility.Hidden
self.window.backgroundColor = NSColor.whiteColor()
UPDATE:
To prevent, that the toolbar becomes transparent in Yosemite (if you have a scrollview below the Toolbar), use this code:
self.window.appearance = NSAppearance(named: NSAppearanceNameAqua)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With