android - 隐藏闪屏 phonegap v3

标签 android ios cordova

我正在尝试确保我的启动画面不会在 iOS PhoneGap v3 中显示

我已按照 their documentation 中的建议尝试了以下操作:

其中包括安装 splash plugin

我马上打电话隐藏

navigator.splashscreen.hide()

项目布局

¬ res
   ¬ icon

config.xml

<gap:plugin name="org.apache.cordova.splashscreen" />
<feature name="SplashScreen">
    <param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" />
    <param name="ios-package" value="CDVSplashScreen" />
</feature>

注意没有启动文件夹。然而,启动屏幕将始终显示并显示默认的phonegap启动屏幕,而不是跳过它。

值得一提的是,我正在通过 https://build.phonegap.com 进行构建

最佳答案

您确定在调用 navigator.splashscreen.hide() 之前触发了 deviceready 事件吗?在触发该事件后立即调用 .hide() 应该会产生您正在寻找的结果。

此外,您可以尝试将闪屏插件完全替换为 cordova 的新替代方案:

cordova.exec(null, null, “SplashScreen”, “hide”, [])

cordova.exec 命令直接连接到不同设备的本地环境。

更详细解释的参数:

function(winParam) {} - Success function callback. Assuming your exec call completes successfully, this function will be invoked (optionally with any parameters you pass back to it)
function(error) {} - Error function callback. If the operation does not complete successfully, this function will be invoked (optionally with an error parameter)
"service" - The service name to call into on the native side. This will be mapped to a native class.
"action" - The action name to call into. This is picked up by the native class receiving the exec call, and, depending on the platform, essentially maps to a class's method.
[/* arguments */] - Arguments to get passed into the native environment

关于android - 隐藏闪屏 phonegap v3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26694862/

相关文章:

java - 无法更新成员变量

javascript - 如何将文件从 PhoneGap/webapp ftp 到服务器?

ios - 平台 "ios"似乎不是有效的 cordova 平台

iphone - 如何找到/获取 CoreMedia.framework 并开始使用它?

ios - 为什么我的按钮在 Swift Playgrounds 中不起作用?

iphone - MKMapView userTrackingMode 被 CLSqliteDatabaseManager 覆盖

javascript - 警报在 Cordova 未定义

java - Volley 请求重试策略不考虑超时

java - 在 android-priority-jobqueue 中检索当前 Activity 作业列表

设备锁定时的 iOS 推送通知操作