views:

749

answers:

2

Hello!

Is it possible to auto-rotate the default application image according to current landscape mode? I can rotate my views just fine according to information from the UIDevice class, but I would like the whole application to be in the correct landscape mode from the start.

+2  A: 

This isn't possible at the moment. If your app is designed to be in landscape mode you can obviously rotate your Default image but there is no way to show a different image or rotate it based on the orientation when your app launches.

Mike Weller
Thank you. How do you know this, is it mentioned somewhere in the documentation?
zoul
It's specifically NOT mentioned anywhere in the documentation. i.e. there are no facilities provided for doing this.
Jim Dovey
A: 

Update

Updated after comments...

A trick you can use: Use a portrait default.png

On launch load the default.png in a UIImageView and perform the rotation yourself.

UIImageview *myImage = [UIImageView alloc] initWithImage:[UIImage imageNamed:@"default.png"]]];

[UIView beginAnimations:@"rotate" context:nil]
[UIView setAnimationDelay:0.25];
[UIView setAnimationDuration:duration];

//rotation transform logic

[UIView commitAnimations];

You can rotate it to where left or right according to your setup. Then fade in your UI with another animation block.


Original answer

This kind of doesn't make sense. There isn't a need to rotate the graphic.

If you launch in landscape, then simply create your launch graphic in landscape (using photoshop or something similar).

If you think sometimes the phone will be in landscape and sometimes it won't during launch, that's not really an issue. The HIGs instruct you to simply display a view in the correct orientation if it only supports that orientation. Example: The Youtube app automatically goes to landscape to show a video and back to portrait to show the table view. You shouldn't compensate for what your user may be doing prior to launch.

Corey Floyd
There are TWO landscape modes, that’s why it would make sense to auto-rotate the splash screen to the current one. Each of the landscape modes is more convenient for different device (iPhone/iPod) and different setup (headphones/speaker).
zoul
2 landscape modes? Are you saying one UIInterfaceOrientationLandscapeLeft and one UIInterfaceOrientationLandscapeRight?If so, there is no way to have a dynamic default.png (changeable, rotatable, etc...).Unfortunately, you'll to rethink your design. I'd probably just launch with a portrait image since it is device agnostic.
Corey Floyd