Question

I have been making an iOS app for a while now, and up until now I have only been testing on iPad and I'm trying to get it working on iPhones and iPods now.

My app is landscape only, and I have set up the allowed orientations in my project file to only allow landscape on both iPads and iPhones. This works great on the iPad... the splash comes up in landscape and it goes onto the app fine. On my iPod it doesn't work so great. I have put all the right portrait images into Xcode but when it loads up (on the simulators and on my iPod) it rotates the image half way through loading. So it starts off with my portrait image in a portrait orientation, and then after a couple of seconds, it then suddenly rotates the image 90 degrees and stretches it to still fit the screen. It then goes on to load the app in landscape. No matter what I try it continues to do this... Can anyone shed some light on the situation? What I want it do is load the splash image and then just fade to app.

Images showing what happens:

http://jamesmcilveen.com/images/1.jpg http://jamesmcilveen.com/images/2.jpg

I have tried setting shouldAutorotateToInterfaceOrientation in all the different viewControllers to only return yes if the orientation is supported and everything like that, but it still doesn't work..

I even restarted my project from a fresh, as in new install of Cordova, and I still get the same problem. I even got the problem when using a fresh unaltered install with the default Cordova splash images.

I have googled for several hours and was surprised that no one else has had the same problem as me?

Oh I'm using Cordova 2.7.0 by the way, forgot to mention that.

Was it helpful?

Solution

In CDVViewController.m in the Cordova files in the "showSplashScreen" function you have to comment out the line

startupImageTransform = CGAffineTransformMakeRotation(degreesToRadian(90));

in all of the if checks, because the device does the rotation for you, then phonegap tries to re-orient it. Hope it works for you!!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top