Trouble matching the vibrant background of a Yosemite NSMenuItem containing a custom view

前端 未结 7 1281
一向
一向 2020-12-14 16:19

I am attempting to add a custom view to an NSMenuItem in the OS X 10.10 Yosemite menu bar.

The custom view is simply an NSView background with an NSTextField “label”

7条回答
  •  悲哀的现实
    2020-12-14 17:02

    It is surely kinda hack, but it worked for me. Try adding an NSImageView with empty image to your custom view. Image view must be occupy the whole view.

    Using an NSImageView

提交回复
热议问题