Cordova splash screen change the position of the spinner?

前端 未结 3 402
臣服心动
臣服心动 2020-12-18 06:42

Does anyone know how to modify the position of the Cordova splash screen spinner? I have checked the documentation and couldn\'t find any information.

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 07:35

    Ok I figured it out, had to manually edit the iOS plugin file "CDVSplashScreen.m" found inside "/plugins/cordova-plugin-splashscreen/src/ios".

    _activityView.center = CGPointMake(parentView.bounds.size.width / 2, parentView.bounds.size.height / 2 + 75);
    

    What that does is makes the spinner 75 pixels lower from the centre of the screen. so "+75" goes towards the bottom of the screen "-75" would do the opposite.

    Hope this helps someone else out there (but wasn't to hard to figure out).

    Additionally if you want to change the colour of the spinner. There are 3 options to choose from (no idea how to change the colour).

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

提交回复
热议问题