I just tried Image Generation from the CLI.
Upload works well and images generated have a good ratio and aspect.
However, running the app on my development devices:
the ratio is NOT respected in Android (Nexus 4), image is distorded
the ratio is respected in iOs (iPhone 4)
Here is my config.xml:
<preference name="SplashScreen" value="screen"/> <!-- `splash` does not work -->
<preference name="SplashScreenDelay" value="20000"/>
<preference name="AutoHideSplashScreen" value="false"/>
I tried with these source images:
PNG file, 2362x2362
AI file (no size since vectorial, but ratio is 1:1 too)
I have the same problem on my Moto G 720x1280 mobile phone and using genymotion with a same resolution mobile emulator.
By the way, splash screen images was created well by the ionic resource tool. There is one splash screen with the 720x1280 resolution in my resources directory : drawable-port-xhdpi-screen.png
So I think I’ve found a much better solution. I use a solid colour image for my ionic/cordova splashscreen.
In run() I hide it immediately using the plugin, then for my first view/controller I display my real splashscreen via html (same background colour as the cordova one - so a seamless transition, and since it’s html I have complete control). Then in that first controller I do any init stuff that takes time (login, load remote assets). When done I show the nav-view/nav-header, and $state change to my next view/controller.
The additional benefit is better debugging in Safari/ios. Since I don’t do anything complex in run() anymore, I don’t have to worry about an error happening there that I can’t debug.
I use ionic resources to create the splash screens from my solid red square template. My run() method has no blocking code and does a navigator.splashscreen.hide() immediately (so that I don’t show the plain red square too long), then loads my index.html and MainCtrl as follows:
I would say @techntrails’ solution is a workaround instead of a fix. But it is a useful technique. Using that, you could also animate a transition between your splash to a login or something. Like slide out the splash’s logo etc.
But ontopic: Did you try a PSD file as well as source input? I always use PSD and have had no troubles on different Android devices so far.
I just recently ran into this problem. It’s because on MotoG and Nexus 4 (and any phone without physical buttons) the screen size is actually smaller than 720x1280 (or whatever).
You lose vertical pixels to show the back, home and recent apps button.
If there were a way to disable the button bar during the splash screen, that would take care of the issue.
On my Samsung Galaxy Nexus and the Nexus 7 tablet the splashscreen shows incorrect as well. My guess is the buttons at the bottom of the screen make the splashscreen show with the wrong aspect ratio.
The problem is “$ ionic resources” produces not 9 patched images. If we use make-9patched-splash-ionic, we should not use “$ ionic resources”. But “ionic resources --icon” is OK.
I’m wondering the script should clean up debug folder automatically…
The solution was to remove the plugin, remove Android platform, remove Crosswalk, then add Android + Crosswalk again, remake icon resources, redo splash with Make-9Patched, and then rebuild (without including the Cordova Splashscreen plugin).