Hide NSWindow title bar

后端 未结 8 1018
萌比男神i
萌比男神i 2020-12-13 00:46

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 botto

8条回答
  •  粉色の甜心
    2020-12-13 01:26

    The only way I know would be to create a window without a titlebar (see NSBorderlessWindowMask). Note that you can't (easily) create a window without a titlebar in IB, so you will have to do a bit of work in code (there are a couple of different approaches, you can probably figure it out).

    A big drawback with using a window without a titlebar is that you're now on the hook for much more of the standard appearance and behaviour - rounded corners and such.

提交回复
热议问题