ios 从 Cordova 应用程序中删除启动画面加载 gif

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11762139/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 19:31:38  来源:igfitidea点击:

Removing splash-screen loading gif from Cordova app

iosxcode4cordova

提问by sam

I'm having a problem overriding Cordova's defaults when writing an app.

编写应用程序时,我在覆盖 Cordova 的默认设置时遇到问题。

I'm writing an iOS app using the Cordova (formerly PhoneGap) framework and Xcode. Cordova lets me add a splash screen for the project by just dragging and dropping it in under the info tab for my project in Xcode. This part works fine, but there is a default loading-indicator gif running over the top of the splash image (I'm not sure whether it's from Xcode or from Cordova).

我正在使用 Cordova(以前称为 PhoneGap)框架和 Xcode 编写一个 iOS 应用程序。Cordova 让我只需将项目拖放到 Xcode 中项目的信息选项卡下,即可为项目添加启动画面。这部分工作正常,但有一个默认的加载指示器 gif 运行在启动图像的顶部(我不确定它是来自 Xcode 还是来自 Cordova)。

How can I remove the loading-indicator image?

如何删除加载指示器图像?

回答by Kelsey

You can remove the loading spinner in Cordova.plist. Set ShowSplashScreenSpinner to false.

您可以删除 Cordova.plist 中的加载微调器。将 ShowSplashScreenSpinner 设置为 false。

Update: In Cordova 3.0+ adding <preference name="ShowSplashScreenSpinner" value="false" />to your config.xml will accomplish the same goal.

更新:在 Cordova 3.0+ 中添加<preference name="ShowSplashScreenSpinner" value="false" />到您的 config.xml 将实现相同的目标。

回答by Ajay

I just removed the Launch images source and set the launch screen file to mainviewcontroller

我刚刚删除了启动图像源并将启动屏幕文件设置为 mainviewcontroller

Go to General Setting -> at bottom side Launch images resource and launch screen setting is available

转到常规设置 -> 在底部启动图像资源和启动屏幕设置可用

回答by Daniel Goncalves

If you have an IOS device i have a working method that you can use, it solved my problem when compiling for IOS. (Firstly i want to say you need to add an icon and splash in the correct folders or else Cordova will their default ones for you and also make sure that they are large enough so that the resources can be generated accordingly):

如果你有一个 IOS 设备,我有一个你可以使用的工作方法,它在为 IOS 编译时解决了我的问题。(首先,我想说您需要在正确的文件夹中添加一个图标并启动图标,否则 Cordova 将为您提供默认的图标,并确保它们足够大,以便可以相应地生成资源):

  1. Remove the SplashScreen plugin provided using
  1. 删除使用提供的 SplashScreen 插件
        cordova plugin rm cordova-plugin-splashscreen
  1. Place your icon in the resources/ios/ folder and name it
  1. 将您的图标放在 resources/ios/ 文件夹中并命名

icon.png

图标.png

  1. Go to the route of your directory and add your splash image (make sure that splash.png is 2800px * 2800px)
  1. 转到您的目录路径并添加您的启动图像(确保 splash.png 为 2800px * 2800px)

splash.png enter image description here

飞溅.png 在此处输入图片说明

  1. Remove the ios platform if you installed it already and then re add it
  1. 如果你已经安装了,请删除ios平台,然后重新添加它
        ionic cordova platform rm ios
        ionic cordova platform add ios

5.Run the following command to generate your icon

5.运行以下命令来生成你的图标

        ionic cordova resources ios --icon

if building for android

如果为安卓构建

        ionic cordova resources android --icon

6.Add the following lines to your config.xml

6. 将以下行添加到您的 config.xml

    <preference name="SplashScreen" value="none" />
    <preference name="SplashScreenDelay" value="0" />
    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="FadeSplashScreen" value="false" />
    <preference name="ShowSplashScreenSpinner" value="false" />

This should solve the default icon and remove the splash screen which Cordova adds to the IOS project by default. I hope it helps!

这应该解决默认图标并删除 Cordova 默认添加到 IOS 项目的启动画面。我希望它有帮助!