gpt4 book ai didi

带有集成标题栏和工具栏的 macOS 窗口?

转载 作者:行者123 更新时间:2023-12-03 05:42:26 29 4
gpt4 key购买 nike

在 macOS 中,如何在 Xcode 和/或 Interface Builder 中创建带有“集成标题栏和工具栏”的窗口?

这是“宽标题栏”类型的窗口,已添加到 OS X 10.10 Yosemite 中的 Safari 和日历等应用程序中。统一的标题栏和工具栏以及其他小工具。

macOS Human Interface Guidelines: Title Bar and Toolbar

A toolbar, when included, resides beneath the title bar (or is integrated with the title bar) and includes controls—known as toolbar items—that provide quick access to frequently used commands and features.

Integrated title bar and toolbar

Integrated title bar and toolbar

最佳答案

  1. 创建标准工具栏。
  2. 窗口加载时,将 titleVisibility 设置为隐藏:

    // Objective-C
    window.titleVisibility = NSWindowTitleHidden;

    // Swift
    window?.titleVisibility = .hidden

关于带有集成标题栏和工具栏的 macOS 窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24023000/

29 4 0