Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在笔尖中有一个 NSButton 设置为一个图标,并且只有一个图标:
当我运行该应用程序时,该图标尽管是AppKit 提供的图像之一,但仍然丢失:
这里发生了什么?为什么我的按钮图标不显示?
好的。在我刚刚创建的小示例应用程序中,我能够让图标出现(不过需要做一些事情)。总结一下,您需要将按钮类型更改为“斜角”并在必要时增加高度。
显然,“Push”风格的 NSButton 类型太窄,无法舒适地显示图标。