本文介绍了Xcode& Swift - 窗口没有标题栏,但有关闭,最小化和调整大小按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在Xcode 6,Beta 5中使用Swift。
我试图删除标题栏,或标题栏和实际内容之间的任何可见差异。如果我在窗口的属性检查器中启用统一标题和工具栏,没有任何可见的情况发生。我已经离开了标题。

当没有标题输入时,标题栏仍然可以区分,因为边框线和背景与窗口的其余部分不同,将其与实际内容分开。

I am currently using Swift in Xcode 6, Beta 5.I am trying to remove the title bar, or any visible difference between the title bar and the actual content. If I enable "Unified title and toolbar" in the Attributes Inspector on a Window, nothing visibly happens. I have already left the title out.
When no title is entered, the title bar will still be distinguishable because of the border line and background difference with the rest of the window, separating it from the actual content.



一个很好的例子是当前的Yosemite,OS X 10.10,Notes应用程序。没有标题栏是可见或可区分,只是关闭,最小化和调整大小按钮,如这里所示。


An excellent example would be the current Yosemite, OS X 10.10, Notes app. No title bar is visible or distinguishable, just the Close, Minimise and Resize buttons as seen here.

我已经搜索和访问过其他帖子,但没有什么可用。

这些提到隐藏标题栏,但我不知道如何手动重新添加关闭,最小化和调整大小按钮正确,意味着他们看起来正确,没有实际的,鬼祟的图像替换和与菜单栏的关闭,关闭,最小化和调整大小的功能。

I have searched and visited other posts, but to no to little avail.
Those mentioned hiding the title bar altogether, but I wouldn't know how to manually re-add the Close, Minimise and Resize buttons properly, meaning they would look correct, no actual, sneaky image replacements and connections with the menu bar Close, Minimise and Resize functions.

/ p>

Thanks!

推荐答案

在OS X 10.10中添加的新窗口样式掩码 NSFullSizeContentViewWindowMask

The new window style mask NSFullSizeContentViewWindowMask added in OS X 10.10 will do the trick.

self.window.titleVisibility = NSWindowTitleVisibility.Hidden;
self.window.titlebarAppearsTransparent = YES;
self.window.styleMask |= NSFullSizeContentViewWindowMask;

这篇关于Xcode& Swift - 窗口没有标题栏,但有关闭,最小化和调整大小按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 14:35