NSPopover color

前端 未结 4 1668
遥遥无期
遥遥无期 2021-02-15 10:33

Is there any way to color NSPopover? Ive seen apps like facetab etc that have cool colors and resizeable popovers, how is this done?

Ay guides, hints?

Thanks.

4条回答
  •  一个人的身影
    2021-02-15 11:28

    Set popover.contentViewController.view as a subclass of NSView with a custom background drawing (i.e. override drawRect: and fill a rect with your custom background color).

    Then set the popover.appearance = NSPopoverAppearanceHUD to remove the default border around the view.

    Note that there will still be a very thin border around the view, so if you want to remove it completely, you may want to use MAAttachedWindow or a similar solution.

提交回复
热议问题