简体   繁体   English

Cordova Splash Screen?

[英]Cordova Splash Screen?

Im doing an app using cordova, and Im trying to use the splash screen for android, but I don't know how to do it or if I have to install a plug-in, the splash screen for iOS is working fine. 我正在使用cordova做一个应用程序,我试图使用启动屏幕的Android,但我不知道该怎么做或如果我必须安装插件,iOS的启动画面工作正常。

Hoping some one can point me on the right direction on how to apply the splash screen for android 希望有人可以指出我如何应用Android的启动画面的正确方向

Check this link : Android splashscreen configuration in Cordova 检查此链接: Cordova中的Android启动画面配置

SplashScreen (string, defaults to splash): The name of the file minus its extension in the res/drawable directory. SplashScreen(字符串,默认为splash):文件名减去res / drawable目录中的扩展名。 Various assets must share this common name in various subdirectories. 各种资产必须在各个子目录中共享此公用名。

Just add this below line inside config.xml file : 只需在config.xml文件中添加以下行:

<preference name="SplashScreen" value="mySplash"/>

Note : mySplash will be a png file from res/drawable folders. 注意mySplash将是来自res / drawable文件夹的png文件。

start splash in MainActivity: super.setIntegerProperty("splashscreen", R.drawable.splash); 在MainActivity中启动splash:super.setIntegerProperty(“splashscreen”,R.drawable.splash); super.loadUrl("file:///android_asset/www/index.html", splash_time_in_ms); super.loadUrl(“file:///android_asset/www/index.html”,splash_time_in_ms);

then stop it somewhere: navigator.splashscreen.hide(); 然后在某处停止:navigator.splashscreen.hide();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM