IBM Worklight - hiding splash screen

不羁的心 提交于 2019-12-23 05:47:09

问题


I want to hide the screen splah of my app and i'm trying to do this with Cordova function navigator.splashscreen.hide() according to this

function wlEnvInit(){
   wlCommonInit();
   document.addEventListener("deviceready", onDeviceReady, false);

   function onDeviceReady() {
       alert("device is ready!");
       navigator.splashscreen.hide();
   }
}

I placed this code on android/js/myAppName.js and iphone/js/myAppName.js folders. It does not work. There is something wrong?


回答1:


I assume what you're trying to do is to hide the splash image at a point in time based on your own preference? This is currently not possible.

Worklight bypasses Cordova's splash image mechanism as well as does not provide an API to manipulate its duration programmatically (= choose when to hide it). This is an area that is destined to change in a future release.

If what you're trying to do is to simply not show a splash image at all, then:

  • In iOS: this is not possible. The splash image is mandatory by Apple
  • In Android: simply delete the splash.9.png image file from the yourProject\apps\yourApp\android\native\res\drawable folder

BTW, I do not see the use for the deviceready listener, because if you've reached wlCommonInit, then the device (Cordova...) has already been initialized. The app would not have functioned otherwise.




回答2:


For the time being, a workaround for it would be by replacing the Splash screen image with a complete white background screen/image.



来源:https://stackoverflow.com/questions/20428624/ibm-worklight-hiding-splash-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!