macOS window with integrated title bar and toolbar?

后端 未结 3 2038
清酒与你
清酒与你 2020-11-29 20:26

In macOS how can I create a window with an "integrated title bar and toolbar" in Xcode and/or Interface Builder?

This is the "fat title bar" type

相关标签:
3条回答
  • 2020-11-29 20:55

    As of Xcode 10, you can do this in your XIB or storyboard by turning on the “Hide Title” check box under the window's title in the window's Attributes Inspector.

    Note also that you should use the “Textured Rounded” style for toolbar buttons.

    0 讨论(0)
  • 2020-11-29 21:01
    1. Create a standard toolbar.
    2. When the window loads, set titleVisibility to hidden:

      // Objective-C
      window.titleVisibility = NSWindowTitleHidden;
      
      // Swift
      window?.titleVisibility = .hidden
      
    0 讨论(0)
  • 2020-11-29 21:07

    In your window controller's windowDidLoad():

    window?.titleVisibility = .hidden
    
    0 讨论(0)
提交回复
热议问题