ionic开发框架-(2)图标及闪屏界面制作

概述

使用ionic命令,会自动在resources文件夹下创建已添加的平台名称的文件夹,如:android,其中会自动将图片进行缩放、裁剪,生成不同分辨率的图片,并在config.xml中添加相应内容。

操作步骤

1.在项目的根目录下创建resources文件夹。
2.在文件夹中都放入icon.png(应用图标,最小192x192px,不带圆角),splash.png(启动屏幕,最小2208x2208px,中间区域1200x1200px)(可以是png、psd、ai)
3.在cmd中进入项目所在文件夹执行:

ionic resources --icon //只会生成图标
ionic resources --splash //只会生成闪屏
ionic resources //同时生成图标及闪屏

生成结果

执行结果
ionic resources
Ionic icon and splash screen resources generator
uploading icon.psd...
uploading splash.psd...
icon.psd (192x192) upload complete
splash.psd (2208x2208) upload complete
generating splash android drawable-port-xxxhdpi-screen.png (1280x1920)...
generating splash android drawable-port-xxhdpi-screen.png (960x1600)...
generating splash android drawable-port-xhdpi-screen.png (720x1280)...
splash android drawable-port-xhdpi-screen.png (720x1280) generated
generating splash android drawable-port-hdpi-screen.png (480x800)...
splash android drawable-port-xxxhdpi-screen.png (1280x1920) generated
generating splash android drawable-port-mdpi-screen.png (320x480)...
splash android drawable-port-xxhdpi-screen.png (960x1600) generated
generating splash android drawable-port-ldpi-screen.png (240x320)...
splash android drawable-port-mdpi-screen.png (320x480) generated
generating splash android drawable-land-xxxhdpi-screen.png (1920x1280)...
splash android drawable-port-hdpi-screen.png (480x800) generated
generating splash android drawable-land-xxhdpi-screen.png (1600x960)...
splash android drawable-port-ldpi-screen.png (240x320) generated
generating splash android drawable-land-xhdpi-screen.png (1280x720)...
splash android drawable-land-xxxhdpi-screen.png (1920x1280) generated
generating splash android drawable-land-hdpi-screen.png (800x480)...
splash android drawable-land-xxhdpi-screen.png (1600x960) generated
generating splash android drawable-land-mdpi-screen.png (480x320)...
splash android drawable-land-xhdpi-screen.png (1280x720) generated
generating splash android drawable-land-ldpi-screen.png (320x240)...
splash android drawable-land-mdpi-screen.png (480x320) generated
generating icon android drawable-xxxhdpi-icon.png (192x192)...
splash android drawable-land-hdpi-screen.png (800x480) generated
generating icon android drawable-xxhdpi-icon.png (144x144)...
icon android drawable-xxhdpi-icon.png (144x144) generated
generating icon android drawable-xhdpi-icon.png (96x96)...
icon android drawable-xxxhdpi-icon.png (192x192) generated
generating icon android drawable-hdpi-icon.png (72x72)...
splash android drawable-land-ldpi-screen.png (320x240) generated

generating icon android drawable-mdpi-icon.png (48x48)...
icon android drawable-hdpi-icon.png (72x72) generated
generating icon android drawable-ldpi-icon.png (36x36)...
icon android drawable-mdpi-icon.png (48x48) generated
splash ios Default~iphone.png (320x480) generated
generating splash ios Default@2x~iphone.png (640x960)...
icon android drawable-xhdpi-icon.png (96x96) generated
generating splash ios Default-Portrait~ipad.png (768x1024)...
icon android drawable-ldpi-icon.png (36x36) generated
generating splash ios Default-Portrait@2x~ipad.png (1536x2048)...
splash ios Default-Portrait~ipad.png (768x1024) generated
generating splash ios Default-Landscape~ipad.png (1024x768)...
splash ios Default@2x~iphone.png (640x960) generated
generating splash ios Default-Landscape@2x~ipad.png (2048x1536)...
splash ios Default-Landscape~ipad.png (1024x768) generated
generating splash ios Default-Landscape-736h.png (2208x1242)...
splash ios Default-Portrait@2x~ipad.png (1536x2048) generated
generating splash ios Default-736h.png (1242x2208)...
splash ios Default-Landscape@2x~ipad.png (2048x1536) generated
generating splash ios Default-667h.png (750x1334)...
splash ios Default-736h.png (1242x2208) generated
generating splash ios Default-568h@2x~iphone.png (640x1136)...
splash ios Default-Landscape-736h.png (2208x1242) generated
generating icon ios icon-small@3x.png (87x87)...
icon ios icon-small@3x.png (87x87) generated
generating icon ios icon-small@2x.png (58x58)...
splash ios Default-667h.png (750x1334) generated
generating icon ios icon-small.png (29x29)...
icon ios icon-small@2x.png (58x58) generated
generating icon ios icon-76@2x.png (152x152)...
splash ios Default-568h@2x~iphone.png (640x1136) generated
generating icon ios icon-76.png (76x76)...
icon ios icon-small.png (29x29) generated
icon ios icon-72@2x.png (144x144) generated
icon ios icon-72.png (72x72) generated
generating icon ios icon-60@3x.png (180x180)...
icon ios icon-76@2x.png (152x152) generated
generating icon ios icon-60@2x.png (120x120)...
icon ios icon-76.png (76x76) generated
generating icon ios icon-60.png (60x60)...
icon ios icon-60.png (60x60) generated
generating icon ios icon-50@2x.png (100x100)...
icon ios icon-60@2x.png (120x120) generated
generating icon ios icon-50.png (50x50)...
icon ios icon-60@3x.png (180x180) generated
generating icon ios icon-40@2x.png (80x80)...
icon ios icon-50.png (50x50) generated
generating icon ios icon-40.png (40x40)...
icon ios icon-40@2x.png (80x80) generated
generating icon ios icon@2x.png (114x114)...
icon ios icon-40.png (40x40) generated
generating icon ios icon.png (57x57)...
icon ios icon-50@2x.png (100x100) generated
icon ios icon.png (57x57) generated
icon ios icon@2x.png (114x114) generated

坑洞说明:

  1. 执行以上命令时需在联网下进行
  2. 生成操作由服务器完成后下载到本地,经常会因为网络太慢导致生成失败,一般我都会选择移动4G热点下完成此操作

生成后的config.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><widget id="com.ild.qos" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>qos</name> <description> An Ionic Framework and Cordova project. </description> <author email="you@example.com" href="http://example.com.com/"> Your Name Here </author> <content src="index.html"/> <access origin="*"/> <preference name="webviewbounce" value="false"/> <preference name="UIWebViewBounce" value="false"/> <preference name="DisallowOverscroll" value="true"/> <preference name="SplashScreenDelay" value="2000"/> <preference name="FadeSplashScreenDuration" value="2000"/> <preference name="android-minSdkVersion" value="16"/> <preference name="BackupWebStorage" value="none"/> <preference name="SplashScreen" value="screen"/> <feature name="StatusBar"> <param name="ios-package" value="CDVStatusBar" onload="true"/> </feature> <platform name="ios"> <icon src="resources/ios/icon/icon.png" width="57" height="57"/> <icon src="resources/ios/icon/icon@2x.png" width="114" height="114"/> <icon src="resources/ios/icon/icon-40.png" width="40" height="40"/> <icon src="resources/ios/icon/icon-40@2x.png" width="80" height="80"/> <icon src="resources/ios/icon/icon-50.png" width="50" height="50"/> <icon src="resources/ios/icon/icon-50@2x.png" width="100" height="100"/> <icon src="resources/ios/icon/icon-60.png" width="60" height="60"/> <icon src="resources/ios/icon/icon-60@2x.png" width="120" height="120"/> <icon src="resources/ios/icon/icon-60@3x.png" width="180" height="180"/> <icon src="resources/ios/icon/icon-72.png" width="72" height="72"/> <icon src="resources/ios/icon/icon-72@2x.png" width="144" height="144"/> <icon src="resources/ios/icon/icon-76.png" width="76" height="76"/> <icon src="resources/ios/icon/icon-76@2x.png" width="152" height="152"/> <icon src="resources/ios/icon/icon-small.png" width="29" height="29"/> <icon src="resources/ios/icon/icon-small@2x.png" width="58" height="58"/> <icon src="resources/ios/icon/icon-small@3x.png" width="87" height="87"/> <splash src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" height="1136"/> <splash src="resources/ios/splash/Default-667h.png" width="750" height="1334"/> <splash src="resources/ios/splash/Default-736h.png" width="1242" height="2208"/> <splash src="resources/ios/splash/Default-Landscape-736h.png" width="2208" height="1242"/> <splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" height="1536"/> <splash src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" height="768"/> <splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" height="2048"/> <splash src="resources/ios/splash/Default-Portrait~ipad.png" width="768" height="1024"/> <splash src="resources/ios/splash/Default@2x~iphone.png" width="640" height="960"/> <splash src="resources/ios/splash/Default~iphone.png" width="320" height="480"/> </platform> <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"/> <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/> <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-land-hdpi-screen.png" density="land-hdpi"/> <splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/> <splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/> <splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/> <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"/> <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/> <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/> <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/> </platform> <icon src="resources/android/icon/drawable-xhdpi-icon.png"/></widget>

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 160,646评论 4 366
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,979评论 1 301
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 110,391评论 0 250
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,356评论 0 215
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,740评论 3 293
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,836评论 1 224
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 32,022评论 2 315
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,764评论 0 204
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,487评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,728评论 2 252
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,200评论 1 263
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,548评论 3 260
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,217评论 3 241
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,134评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,921评论 0 201
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,919评论 2 283
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,766评论 2 274

推荐阅读更多精彩内容