隐藏NSWindow标题栏 [英] Hide NSWindow title bar

查看:658
本文介绍了隐藏NSWindow标题栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在NSWindow中隐藏标题栏?我不想完全写一个新的自定义窗口。我不能使用NSBorderlessWindowMask,因为我有一个底栏在我的窗口,并使用NSBorderlessWindowMask使它消失。我也尝试使用setContentBorderThickness:forEdge:与NSMaxYEdge和设置为0,也没有工作。

Is there a way to hide the titlebar in an NSWindow? I don't want to have to completely write a new custom window. I can't use NSBorderlessWindowMask because I have a bottom bar on my window, and using NSBorderlessWindowMask makes that disappear. I also tried using setContentBorderThickness:forEdge: with NSMaxYEdge and setting it to 0, that didn't work either.

任何帮助

推荐答案

[yourWindow setStyleMask:NSBorderlessWindowMask];

这篇关于隐藏NSWindow标题栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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