cordova配置icon和splash

http://www.tuicool.com/articles/FbEj2u

http://www.itnose.net/detail/6101101.html

1、添加插件
cordova plugin add org.apache.cordova.splashscreen
2、图片要放到项目下新建的res目录或www目录中去
编译时会copy到platform/android/res/drawable中

修改config.xml配置文件

    <preference name="SplashScreen" value="screen" /> <!-- 不带后缀png的文件名,默认是screen-->
    <preference name="SplashScreenDelay" value="3000" /> <!-- Splash显示时间,默认是3000ms-->
    <feature name="SplashScreen">
        <param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" />
    </feature>

修改启动图片

可以看到启动图片的名字是screen.png,工程下有一些screen.png默认图片了,上面显示的是cordova logo,下面需要把这些图片换成你自己的启动画面,不需要支持的尺寸图片直接删掉就可以了。

在设备初始化完成后隐藏Splash画面

document.addEventListener("deviceready", onDeviceReady, false);  
function onDeviceReady() {  
  navigator.splashscreen.hide();  
}  

如果使用了ionic框架,直接在app.js 文件的  .run(['$ionicPlatform', function ($ionicPlatform) {   ... } 里面加上 
navigator.splashscreen.hide();

就可以了。

原文地址:https://www.cnblogs.com/panzulong/p/4108652.html