Cordova splash screen change the position of the spinner?

前端 未结 3 414
臣服心动
臣服心动 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:39

    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/

                final WindowManager win = (WindowManager)webView.getContext().getSystemService(Context.WINDOW_SERVICE);
                final Display display = win.getDefaultDisplay();
                final Point size = new Point();
                display.getRealSize(size);
    
                // add padding to (top) spinner
                progressBar.setPadding(0, (size.y / 2), 0, 0);
                centeredLayout.addView(progressBar);
    

提交回复
热议问题