IBM Worklight - 隐藏启动画面 [英] IBM Worklight - hiding splash screen

查看:129
本文介绍了IBM Worklight - 隐藏启动画面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想隐藏我的应用程序的屏幕splah,我正在尝试使用Cordova函数 navigator.splashscreen.hide()根据这个

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

函数onDeviceReady(){
alert(设备就绪!);
navigator.splashscreen.hide();
}
}

我将此代码放在上android / js / myAppName.js iphone / js / myAppName.js 文件夹。这是行不通的。有什么不对吗?

解决方案

我假设您要做的是在某个时间点隐藏启动图像根据自己的喜好?目前这是不可能的。



Worklight绕过Cordova的启动图像机制,并且不提供API来以编程方式操作其持续时间(=选择何时隐藏它)。这是一个注定要在未来版本中更改的区域。



如果你要做的就是根本不显示启动图像,那么:




  • 在iOS中:这是不可能的。 Apple必须使用启动图像

  • 在Android中:只需从<$ c $中删除 splash.9.png 图像文件c> yourProject\apps\yourApp\android\\\
    ative\res\drawable 文件夹



<顺便说一句,我没有看到 deviceready 监听器的使用,因为如果你已经达到 wlCommonInit ,那么设备(Cordova ...)已经初始化。该应用程序不会起作用。


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?

解决方案

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.

这篇关于IBM Worklight - 隐藏启动画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆