Oejia 技术栈
首页
应用市场
方案
OE学院
分享
关于
编辑器
登录
Cordova设置应用图标icon和启动页面SplashScreen
on 2014-12-15
Cordova通过配置CLI (config.xml) 来实现应用图标和启动展示图片页面 ### 应用图标icon ```xml <icon src="res/icon.png" /> ``` ### 启动页面SplashScreen 在使用SplashScreen之前需要给项目添加splashscreen插件 ``` > cordova plugin add org.apache.cordova.splashscreen ``` 基本示例 ```xml <platform name="android"> <icon src="res/android/ldpi.png" density="ldpi" /> <icon src="res/android/mdpi.png" density="mdpi" /> <icon src="res/android/hdpi.png" density="hdpi" /> <icon src="res/android/xhdpi.png" density="xhdpi" /> </platform> ``` 目前(Cordova 3.5.0)已经支持的平台 > * android > * ios > * wp8 > * windows8 > * blackberry10 多平台与多分辨率 ```xml <platform name="android"> <!-- you can use any density that exists in the Android project --> <splash src="res/screen/android/splash-land-hdpi.png" density="land-hdpi"/> <splash src="res/screen/android/splash-land-ldpi.png" density="land-ldpi"/> <splash src="res/screen/android/splash-land-mdpi.png" density="land-mdpi"/> <splash src="res/screen/android/splash-land-xhdpi.png" density="land-xhdpi"/> <splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi"/> <splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi"/> <splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi"/> <splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi"/> </platform> <platform name="ios"> <!-- images are determined by width and height. The following are supported --> <splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/> <splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/> <splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/> <splash src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/> <splash src="res/screen/ios/Default-Landscape~ipad.png" width="1024" height="768"/> <splash src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/> <splash src="res/screen/ios/Default-568h@2x~iphone.png" width="640" height="1136"/> <splash src="res/screen/ios/Default-667h.png" width="750" height="1334"/> <splash src="res/screen/ios/Default-736h.png" width="1242" height="2208"/> <splash src="res/screen/ios/Default-Landscape-736h.png" width="2208" height="1242"/> </platform> <platform name="wp8"> <!-- images are determined by width and height. The following are supported --> <splash src="res/screen/wp8/SplashScreenImage.jpg" width="768" height="1280"/> </platform> <platform name="windows8"> <!-- images are determined by width and height. The following are supported --> <splash src="res/screen/windows8/splashscreen.png" width="620" height="300"/> </platform> <platform name="blackberry10"> <!-- Add a rim:splash element for each resolution and locale you wish --> <!-- http://developer.blackberry.com/html5/documentation/rim_splash_element.html --> <rim:splash src="res/screen/windows8/splashscreen.png"/> </platform> <preference name="SplashScreenDelay" value="10000" /> ``` 初始化完成后隐藏Splash画面 ```js document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { navigator.splashscreen.hide(); } ``` ###参考地址 [官方说明](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html#Icons%20and%20Splash%20Screens) ### 注意 以上图像的路径都是相对于工程根目录而非www
Information
Cordova设置应用图标icon和启动页面SplashScreen
http://www.oejia.net/article/e2d4a356a894e4b30d13cc614ff9a82c
http://www.oejia.net/raw/e2d4a356a894e4b30d13cc614ff9a82c
on 2014-12-15
Category
移动开发
Tag
HTML5
Related
2020-09-30 :
Odoo 小程序商城模块 Oejia_weshop v0.2.2 发布,全面支持多公司销售机制
2019-09-30 :
小程序商城模块 Oejia_weshop v0.1.5 发布,新版的UI及系列后端优化
2022-02-03 :
Git The text is identical , but the files do not match !
2018-12-14 :
Odoo12 菜单定制模块 Oejia_menu v0.2.1 发布!
2022-12-30 :
企业微信错误码:60020 的处理
2018-11-19 :
支付对接相关
2017-12-26 :
Odoo 前端开发可用的内置JS功能介绍
2018-07-07 :
Odoo 菜单美化的扩展模块
2019-01-30 :
Qweb 渲染过程研究
2021-05-14 :
Odoo 小程序商城模块 Oejia_weshop v0.2.3 发布,多形式的客户资产及客户分级,多商户供应流程的管理
官方订阅号
关注订阅实时了解我们更多分享
分类
(20)
Django (3)
DjangoX (13)
JS (2)
Nginx (1)
Odoo (134)
Python (1)
YouMd (3)
公告说明 (2)
前端 (2)
后端HTTP (7)
异常处理 (1)
桌面UI (1)
移动开发 (4)
About This Entry
Cordova页面加载的事件
Cordova配置config.xml详解
About This Blog
main index
to find recently
archives
to find all
标签
微信模块发布记录
微信模块
小程序商城
Web
Http
客服系统
OE商城
审批OA
HTML5
Markdown
DjangoX
markdown
PyQT
Python
示例
md
YouPBX
oeshop
服系统
Excel
解析
最近发布
OSError [Errno 5] Input/output error 异常处理
Odoo context 的常见使用示例
Odoo 符合国人菜单导航习惯的后台主题,支持最新的Odoo17、16等版本,支持企业版!
Odoo 官方应用市场开启 Odoo17 应用的发布!增加了行业应用专栏
Odoo商城模块 Oejia_weshop v1.2 发布,多商户、分销增强,增加商家端!
处理 Error Failed to download metadata for repo ‘appstream‘ Cannot prepare internal mirrorlist
Odoo 16 关键变化 change the term "acquirer" to "provider"
企业微信错误码 81013 的排查与处理
微信模块 Oejia_wx v0.6.7 发布,支持 Odoo16 及新的Websocket消息模式
Friend Links
Oejia技术梦博客分享
YouMd,爱上MarkDown
Mole轻量级wsgi架子