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.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
I could fix this for Android in a different way, unfortunately the solution from Matt did not work for me.
So what i did was to use a native Padding Method for the progressbar inside the "spinnerStart" Method. If anyone is interested in my solution, i have 75% padding from top of the Screen for both ios&android (sputn1k´s solution is also integrated). You can Fork and further improve it for your needs when you need a different padding
https://github.com/kaya18/cordova-plugin-splashscreen/
For android, a similar fix is in
platforms/android/src/org/apache/cordova/splashscreen/SplashScreen.java
in
spinnerStart()
change theGravity
value, andRelativeLayout
rule.e.g. to put spinner at the bottom:
change
centeredLayout.setGravity(Gravity.CENTER);
to
centeredLayout.setGravity(Gravity.BOTTOM);
and change
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
to
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
List RelativeLayout options: https://developer.android.com/reference/android/widget/RelativeLayout.html
List of Gravity options: https://developer.android.com/reference/android/view/Gravity.html
Ok I figured it out, had to manually edit the iOS plugin file "CDVSplashScreen.m" found inside "/plugins/cordova-plugin-splashscreen/src/ios".
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):
white
whiteLarge
Found in the files: