How can I create Yosemite-style unified toolbar in

2019-01-12 23:45发布

问题:

In OS X 10.10+ how can I create the "fat titlebar" kind of window that has a toolbar integrated with other gadgets in the window's title bar, like in the new Safari and Calendar?

回答1:

  1. Create a standard toolbar
  2. When the window loads set:

    window.titleVisibility = NSWindowTitleHidden; // or .Hidden in Swift
    


回答2:

In your Window Controller:

Put the following into your windowDidLoad override function.

self.window!.titleVisibility = NSWindowTitleVisibility.Hidden