首页 文章

在cordova-plugin-splashscreen中更改Splash Screen Spinner的颜色

提问于
浏览
5

我即将用Ionic / Cordova完成我的第一个App .

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

我想知道我是否可以改变 color of my Splash-Screen-Spinner .

有任何想法吗?我搜索死源代码:颜色,微调......,但我没有找到提示 .

我想这会对很多人有所帮助 .

问候

3 回答

  • 0

    至少在Cordova 7.0和Cordova iOS 4.4.0中,有's no need to change the splash screen plugin'的源代码 . 您可以将以下行添加到 config.xml 文件中,并且微调器将显示为白色而不是灰色 .

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

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

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

    我相信该声明指的是以下微调器:

    enter image description here

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

    enter image description here

    希望有所帮助 .

  • 0

    如果你想在iOS上更改“cordova-plugin-splashscreen”Spinner颜色 . 有3种预定义颜色选项可供选择(不知道如何将其更改为任何颜色) . 您必须手动编辑“/ plugins / cordova-plugin-splashscreen / src / ios”中的iOS插件文件“CDVSplashScreen.m” .

    gray (default - search for this line):

    UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray
    

    white

    UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhite;
    

    whiteLarge

    UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhiteLarge
    

    Found in the files:

    /*
     * 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

  • 1

    SplashScreenSpinnerColor(字符串,默认为系统重音颜色):hash,rgb表示法或CSS颜色名称 .

    config.xml 中,您可以添加以下首选项:

    <preference name="SplashScreenSpinnerColor" value="white" />
    

    您也可以更改 SplashScreenBackgroundColor

    <preference name="SplashScreenBackgroundColor" value="0xFFFFFFFF"/>
    

    请参阅this链接以获取更多信息 .

相关问题