在cordova-plugin-splashscreen

时间:2016-03-11 15:05:43

标签: cordova ionic-framework cordova-plugins splash-screen

我即将用Ionic / Cordova完成我的第一个应用程序。

是的,它很棒,但有时我想知道为什么事情如此复杂(包括所有插件和东西:))

我想知道我是否可以更改Splash-Screen-Spinner的 颜色

任何想法?我在源代码中搜索:Color,Spinner .....,但我没有找到提示。

我认为这会对很多人有所帮助。

问候

3 个答案:

答案 0 :(得分:1)

至少在Cordova 7.0和Cordova iOS 4.4.0中,无需更改启动画面插件的源代码。您只需将以下行添加到config.xml文件中,微调器就会显示为白色而不是灰色。

<preference name="TopActivityIndicator" value="whiteLarge" />

注意:对于微调器,Apache Cordova文档有点令人困惑。 config.xml指南说明了以下TopActivityIndicator

  

控制状态栏中小旋转图标的外观,指示显着的处理器活动。

我认为该陈述涉及以下微调:

enter image description here

但是,至少在iOS和Cordova 7.0上,更改TopActivityIndicator会影响应用程序打开时屏幕中间显示的微调器的外观。以下是whiteLarge设置的示例:

enter image description here

希望有所帮助。

答案 1 :(得分:0)

如果你想改变&#34; cordova-plugin-splashscreen&#34; iOS上的微调颜色。有3种预定义颜色选项可供选择(不知道如何将其更改为任何颜色)。您必须手动编辑iOS插件文件&#34; CDVSplashScreen.m&#34;发现在&#34; / plugins / cordova-plugin-splashscreen / src / ios&#34;。

灰色(默认 - 搜索此行):

UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray

白色

UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhite; 

<强> whiteLarge

UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhiteLarge

在文件中找到:

/*
 * The Activity View is the top spinning throbber in the status/battery bar. We init it with the default Grey Style.
 *
 *     whiteLarge = UIActivityIndicatorViewStyleWhiteLarge
 *     white      = UIActivityIndicatorViewStyleWhite
 *     gray       = UIActivityIndicatorViewStyleGray
 *
 */

我还找到了一种更改微调器位置的方法,可以查看我的stack post here

答案 2 :(得分:0)

  

(base) C:\Users\antoi>conda install -c conda-forge newspaper3k Solving environment: done ## Package Plan ## ... Proceed ([y]/n)? y Preparing transaction: done Verifying transaction: done Executing transaction: failed ERROR conda.core.link:_execute(502): An error occurred while uninstalling package 'defaults::qt-5.9.6-vc14h1e9a669_2'. PermissionError(13, 'The process cannot access the file because it is being used by another process') Attempting to roll back. Rolling back transaction: done PermissionError(13, 'The process cannot access the file because it is being used by another process') (字符串,默认为系统强调色):   哈希,rgb表示法或CSS颜色名称。

在您的SplashScreenSpinnerColor中,您可以添加以下首选项:

config.xml

您还可以更改<preference name="SplashScreenSpinnerColor" value="white" />

SplashScreenBackgroundColor

进一步参考this链接。

相关问题