user1799879
user1799879

Reputation: 119

Cordova/Phonegap iPhone splashscreen bug

I'm using cordova 2.6 to make an iPhone application in Landscape mode only.

I've a problem with my splashscreen, when I launch app I see the good one during view seconds, then it rotate automatically before loading index page.

All params in plist, xcode and xml are on landscape mode, splashscreen has good size and all works fine on iPad. I know there is no landscape splashscreen for iPhone, I just want it still in portrait, don't rotate after view seconds.

As I can see problem is due to the splashscreen plugin of Cordova who create a view in the bad orientation after display the good splashscreen.

Thanks for your help

Upvotes: 2

Views: 2000

Answers (1)

Nixus
Nixus

Reputation: 378

There is a bug in CordovaLib\Classes\CDVSplashScreen.m where it only switches out the images on an iPad for Landscape vs Portrait.

if you remove the line

} else if (CDV_IsIPad()) {

and the corresponding } then landscape will work across devices. You will need to ensure that your Resources\splash folder has the following files in it:

iPad:

  • Default-Portrait~ipad.png (768x1004px)
  • Default-Landscape~ipad.png (1024x748px)

iPad @2x:

  • Default-Portrait@2x~ipad.png (1536x2008px)
  • Default-Landscape@2x~ipad.png (2048x1496px)

iPhone:

  • Default-Portrait~iphone.png (320x480px)
  • Default-Landscape~iphone.png (480x320px)

iPhone @2x:

  • Default-Portrait@2x~iphone.png (640x960px)
  • Default-Landscape@2x~iphone.png (960x640px)

iPhone 5 @2x:

  • Default-568h-Portrait@2x~iphone.png (640x1136px)
  • Default-568h-Landscape@2x~iphone.png (1136x640px)

Hope that helps

Upvotes: 1

Related Questions