> 文档中心 > HarmonyOS3.1工程之图标配置(ArkTS)

HarmonyOS3.1工程之图标配置(ArkTS)

今天整理下在sdk为3.1,api版本为9的组合下,鸿蒙应用开发的工程配置。

首先是我们App的图标配置,在HarmonyOS中,图标和标签通常一起配置,图标有应用图标和入口图标;标签也有应用标签和入口标签。

应用图标和应用标签在设置应用中使用,入口图标则就是我们安装应用后手机桌面上的那个图标。

入口图标是以Ability为粒度的,支持同一个应用存在多个入口图标和标签的,点击后进入对应的Ability界面。

入口图标和入口标签在module.json5这个文件里配置。

配置后效果

应用图标和应用标签在app.json5这文件里配置。

设置后的效果:

 

 

当我在当前工程里再添加一个ability以后,我就可以配置应用安装后,桌面有两个App图标,分别进入不同的界面,看下module.json5

{  "module": {    "name": "entry",    "type": "entry",    "description": "$string:module_desc",    "mainElement": "EntryAbility",    "deviceTypes": [      "phone"    ],    "deliveryWithInstall": true,    "installationFree": false,    "pages": "$profile:main_pages",    "abilities": [      { "name": "EntryAbility", "srcEntrance": "./ets/entryability/EntryAbility.ts", "description": "$string:EntryAbility_desc", "icon": "$media:aa", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:icon", "startWindowBackground": "$color:start_window_background", "visible": true, "launchType": "standard", //singleton,standard,specified "skills": [   {     "entities": ["entity.system.home"     ],     "actions": ["action.system.home"     ]   } ]      },      { "name": "EntryAbility2", "srcEntrance": "./ets/entryability2/EntryAbility2.ts", "description": "$string:EntryAbility2_desc", "icon": "$media:bb", "label": "$string:EntryAbility2_label", "startWindowIcon": "$media:icon", "startWindowBackground": "$color:start_window_background", "visible": true, "skills": [   {     "entities": ["entity.system.home"     ],     "actions": ["action.system.home"     ]   } ]      }    ]  }}

安装后的效果:

 

----完----