Hide NSWindow title bar

后端 未结 8 1016
萌比男神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:40

    What happens if you get the superview of the close button? Can you hide that?

    // Imagine that 'self' is the NSWindow derived class
    NSButton *miniaturizeButton = [self standardWindowButton:NSWindowMiniaturizeButton];
    NSView* titleBarView = [miniaturizeButton superview];
    [titleBarView setHidden:YES];
    

提交回复
热议问题