iphone - presenting an alertview with the right orientation

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-23T08:39:30Z Indexed on 2010/03/23 10:23 UTC
Read the original article Hit count: 540

Filed under:
|
|

I have to present an alertview when my app starts. My app supports both landscape modes.

Despite the landscape mode the device is when the app starts the alertview always shows in portrait.

I have tried to use the accelerometer to detect the interface orientation before the orientation notification and I have the correct orientation 2 seconds before the alertview showing.

Then, I use this code to set the status bar to a different orientation, hoping the alertview will follow...

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];

or left, depending on the landscape mode.

Nothing works.

Is there a way to force the alertview to respect the orientation?

The point here is this: I cannot set one landscape orientation in particular for the status bar, I have to detect the orientation the device is on and then set the status bar orientation.

thanks for any help.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk