带有集成标题栏和工具栏的macOS窗口? [英] macOS window with integrated title bar and toolbar?

查看:209
本文介绍了带有集成标题栏和工具栏的macOS窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

这是脂肪标题栏"类型的窗口,已添加到OS X 10.10 Yosemite中的Safari和Calendar等应用程序中.统一的标题栏和工具栏以及其他小工具.

This is the "fat title bar" type of window that was added to apps such as Safari and Calendar in OS X 10.10 Yosemite. Unified title bar and toolbar plus other gadgets.

macOS人机界面指南:标题栏和工具栏

工具栏(包括)位于标题栏(或与标题栏集成)下方,并包含控件(称为工具栏项),可快速访问常用的命令和功能.

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.

集成的标题栏和工具栏

推荐答案

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

// Objective-C
window.titleVisibility = NSWindowTitleHidden;

// Swift
window?.titleVisibility = .hidden

这篇关于带有集成标题栏和工具栏的macOS窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆