Cocoa - Custom appearance of NSStatusItem in menu bar

旧城冷巷雨未停 提交于 2019-12-04 13:59:15

问题


It is easy to set the title and length of an NSStatusItem. Is is possible to change the appearance of the NSStatusItem entirely, and replace it with a custom view?

For example, if I want my NSStatusItem to be a whole row of icons surrounded by a border, rather than just a single icon, and each icon can be separately clicked. Is this possible?


回答1:


Got it. I can use NSStatusItem's setView: method to completely customize the appearance of the NSStatusItem.

An example of this is here.



来源:https://stackoverflow.com/questions/4952412/cocoa-custom-appearance-of-nsstatusitem-in-menu-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!