我注意到图像大小,无论我使用哪种图像,它都比macOS菜单栏中的其他应用程序图像小得多。
这是我在可可中使用的代码:
private lazy var statusItem: NSStatusItem = NSStatusItem()
statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
if let button = statusItem.button {
button.image = NSImage(systemSymbolName: "wifi", accessibilityDescription: "1")
}
如何使我的图像大小与其他应用程序的大小相同?
结果:
1条答案
按热度按时间8yparm6h1#
下面的源代码应该使图标变大,但可能太大了。你可以在这里读到:
NSImageSymbolConfiguration