user1442543
user1442543

Reputation: 51

iPad launch image is upside down (portrait) for landscape-only app regardless of rotation

I am developing a universal app. My deployment target is 5.1 I want it to run portrait-only on the iPhone/iPod, and in landscape-only on the iPad.

I am testing with the iPhone and iPad simulators, as well as the latest versions of the iPod touch and iPad.

It works as expected on the iPhone. The portrait launch image comes up first, then the app starts. No problems. It works fine on the simulator as well as my iPod. No matter what the rotation, the app starts and continues to run in portrait (bottom home button), which is as intended.

It works correctly in the iPad simulator. The landscape launch image comes up, then the app starts in landscape. Whatever the rotation, the launch image and the app start and run in landscape as expected.

However, on my iPad, the portrait launch image displays in portrait-upside-down, no matter which way the iPad is rotated. When I remove the Default-Portrait~ipad.png and Default-Portrait@2x~ipad.png files from my project, XCode replaces them with Default.png and [email protected], which are for the iPhone--not the iPad, and which also launch upside down.

My InfoPlist includes these settings: Initial interface orientation: Portrait (bottom home button) (There is no key for Initial Interface orientation~ipad) Supported interface orientations: Portrait (bottom home button) Supported interface orientations~ipad: Landscape (left home button) Landscape (right home button)

I tried changing the Initial interface orientation to Landscape, and I tried removing that key altogether. Neither change made a difference in the way it ran.

I’ve now tried everything I can think of to make this work. Does anybody have a solution?

Thanks.

Upvotes: 1

Views: 2258

Answers (2)

Pierre
Pierre

Reputation: 58

I had a similar issue and was able to fix this issue by changing the order of the supported orientations in the plist file to be [0]:LandscapeRight and [1]:LandscapeLeft

Upvotes: 2

user1442543
user1442543

Reputation: 51

Okay, I finally fixed the problem. Seems like a bug in XCode to me, but I should have caught it.

I located all my image files in the "Supporting Files" folder. This was not a problem for my music files or most of my image files. However, when it came to my Default-Landscape~ipad.png and Default-Landscape@2x~ipad files, XCode did not like it.

I had dragged those files into their respective boxes on the Summary page, and they were accepted. Then I moved them from the top level folder to the "Supporting Files" folder--just like I had done with the Default.png and [email protected] files for the iPhone.

When I built the app, I got no errors. When I ran the app, I got no warnings.

However, HERE IS WHERE I WENT WRONG. I did not run the app with the Profiler until late in the game, and apparently even when I did, I must have ignored the two warnings. Finally, I noticed them: Icon specified in the Info.plist not found under the top level app wrapper: Default-Landscape~ipad.png. I had the same warning for Default-Landscape@2x~ipad.png.

So, I deleted those two files from my project. Then I dragged them into their respective boxes on the Summary page, just as I had done before. But this time I did not move the files from the top project folder. I ran a Clean. Then I ran the app.

IT'S FIXED.

Hope this helps somebody else. ;)

Upvotes: 4

Related Questions