如何为Electron / Atom Shell App设置应用程序图标 [英] How to set app icon for Electron / Atom Shell App
问题描述
如何为您的Electron应用设置应用图标?
How do you set the app icon for your Electron app?
我正在尝试 BrowserWindow({icon:'path / to / image .png'});
但它不起作用。
I am trying BrowserWindow({icon:'path/to/image.png'});
but it does not work.
我是否需要打包应用才能看到效果?
Do I need to pack the app to see the effect?
推荐答案
创建 BrowserWindow时设置
仅对Windows和Linux有影响。图标
属性
Setting the icon
property when creating the BrowserWindow
only has an effect on Windows and Linux.
要在OS X上设置图标,可以使用 electron-packager 并使用 - icon
开关设置图标。
To set the icon on OS X, you can use electron-packager and set the icon using the --icon
switch.
OS X需要采用.icns格式。有一个在线图标转换器,可以从.png。
It will need to be in .icns format for OS X. There is an online icon converter which can create this file from your .png.
这篇关于如何为Electron / Atom Shell App设置应用程序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!