Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova android splashscreen are distorted

I have a Cordova app with a splashscreen at start. The splashscreen is shown but it's distorted. It seems to don't take the good resolution.

My splash is a Bitmap image, I don't care if its cropped but I don't want it to be distorted.

I have the following structure with splashscreen at differents size according to the doc:

drawable-xhdpi/
  splash.png   // 960 x 720px
drawable-hdpi/
  splash.png   // 640 x 480px
drawable-mdpi/
  splash.png   // 470 x 320px
drawable-ldpi/
  splash.png   // 426 x 320px

Is it a Cordova bug? Did I miss something?

I tested with few devices like Galaxy s3 mini, HTC but I got the samed problem on each device.

It works well in iOs.

I used cordova 3.3 and upgraded it recently to 3.4 but got the problem still persist.

like image 379
Tib Avatar asked Dec 17 '25 01:12

Tib


1 Answers

In my case, adding

<preference name="SplashMaintainAspectRatio" value="true" />

to config.xml solved the distortion problem for me.

like image 142
martinoss Avatar answered Dec 19 '25 16:12

martinoss