1、在项目的根目录下创建resources文件夹。
2、在文件夹中都放入icon.png(应用图标,最小192x192px,不带圆角),splash.png(启动屏幕,最小2208x2208px,中间区域1200x1200px)(可以是png、psd、ai)
3、在cmd中进入项目所在文件夹执行:
ionic resources --icon ionic resources --splash
4、项目中的config文件中是这样
<platform name="android"> <icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/> <icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/> <icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/> <icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/> <icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/> <splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi"/> <splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi"/> <splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/> <splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/> <splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/> </platform> <icon src="resources\android\icon\drawable-xhdpi-icon.png"/>
5、因为在运行的时候要上传图片,所以需要联网
时间: 2024-10-30 07:09:14