删除iOS的启动画面 [英] Remove splash screen for iOS

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

问题描述

我想在iOS应用程式中移除启动画面。



我在互联网上搜寻过很多方法,但是这种方式不适合我。



我下载了ngCordova并添加了<$到 cordova.js 之前的我的应用程序,然后在 app.js ng-cordova.js code>我使用 ngCordova

  angular.module 'myApp',['ionic','starter.controllers','ngCordova'])

.run(function($ ionicPlatform,$ cordovaSplashscreen){

$ cordovaSplashscreen .hide();
});

我收到此错误:

  0 533012错误TypeError:undefined不是一个对象(评估'navigator.splashscreen.hide'),http://192.168.1.28:8100/lib/ngCordova/dist/ng- Lineova.min.js,Line:2 

2- with navigator.splashscreen: strong>
根据许多解决方案,我使用navigator.splashscreen.hide()但是这样我得到这个错误:

  0 693078错误TypeError:undefined不是一个对象(评估navigator.splashscreen.hide),http://192.168.1.28:8100/js/app.js,行:13 

3-与cordova.exec:
至少我使用cordova.exec:

  cordova.exec(null,null,SplashScreen,hide,[]); 

但我收到此错误消息:

  0 803835错误TypeError:undefined不是一个函数(评估'cordova.exec(null,null,SplashScreen,hide,[])'),http://192.168 .1.28:8100 / js / app.js,行:12 

我使用



我应该做什么? 删除splassh屏幕?

解决方案

我有同样的问题,
后经过很多乱七八糟我发现我做错误的数量:



这些提示适用于我使用插件的几个问题:



1)确保
'lib / ngCordova / dist / ng-cordova.min.js'
之后是
'lib / ionic / js / ionic.bundle .js'



2)请确保您尚未删除cordova.js,并且之前
(我为浏览器开发,但是你需要它的模拟器和移动设备)。



3)确保你在ready块:

  $ ionicPlatform.ready(function(){$ cordovaSplashscreen.hide();});  

/ p>

4)有时(特别是facebook插件),你需要删除平台,并重新添加它(需要5秒)。



如果一个插件给你错误(像facebook一样):
a)先删除插件
b)然后删除平台
c )然后添加平台
d),然后添加插件。


I want to remove splash screen in iOS app.

I searched in internet and found many ways which work for others, but this ways don't work for me.

1- with ngCordova :

I downloaded ngCordova and add ng-cordova.js to my app before cordova.js and then in app.js I use ngCordova :

angular.module('MyApp', ['ionic', 'starter.controllers', 'ngCordova'])

    .run(function ($ionicPlatform, $cordovaSplashscreen) {

        $cordovaSplashscreen.hide();
    });

with this code I get this error:

0     533012   error    TypeError: undefined is not an object (evaluating 'navigator.splashscreen.hide'), http://192.168.1.28:8100/lib/ngCordova/dist/ng-cordova.min.js, Line: 2

2- with navigator.splashscreen : According to many solutions I use navigator.splashscreen.hide() but in this way I get this error:

0     693078   error    TypeError: undefined is not an object (evaluating 'navigator.splashscreen.hide'), http://192.168.1.28:8100/js/app.js, Line: 13

3- with cordova.exec: at least I use cordova.exec :

cordova.exec(null, null, "SplashScreen", "hide", []);

But I get this error message :

0     803835   error    TypeError: undefined is not a function (evaluating 'cordova.exec(null, null, "SplashScreen", "hide", [])'), http://192.168.1.28:8100/js/app.js, Line: 12

I using ionic with cordova 4.1.2 on MacBook Pro .

What should I do for removing splassh screen ?

解决方案

I had the same problem, after a lot of messing around I found I did a number of things wrong:

These tips apply for a few issues I've had with plugins:

1) make sure 'lib/ngCordova/dist/ng-cordova.min.js' is after 'lib/ionic/js/ionic.bundle.js'

2) make sure you haven't removed 'cordova.js' and that it comes after the prior ones. (I did for browser development but you need it for the emulator and mobile device).

3) make sure you are inside the ready block:

$ionicPlatform.ready(function() {
    $cordovaSplashscreen.hide();
});

4) sometimes (especially the facebook plugin) you need to remove the platform and re add it (takes 5 seconds).

if a plugin gives you errors (like the facebook one): a) remove the plugin first b) then remove the platform c) then add the platform d) then add the plugin.

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

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