如何为Electron / Atom Shell App设置应用程序图标 [英] How to set app icon for Electron / Atom Shell App

查看:581
本文介绍了如何为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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆