In my applicationDidFinishLaunching I have:
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:NO];

Out of curiosity, what version of iPhone OS are you building for? If you're using 2.1 and later, it should just work. If not, you'll need to do something like this as well (I typed this in Mail so there may be blood...err...typos).

CGAffineTransform transform = self.view.transform
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame]; CGRect bounds = CGRectMake(0, 0, statusBarFrame.size.height, statusBarFrame.origin.x); CGPoint centerPoint = CGPointMake(bounds.size.height / 2.0, bounds.size.width / 2.0);
self.view.center = centerPoint;
transform = CGAffineTransformRotate (transform, (M_PI / 2.0));
self.view.transform = transform.

and then...

[window makeKeyAndVisible];

(otherwise the window will show and then rotate in a rather harsh fasion that the user would see)

2. when i create and show a UIAlertView it appears in portrait, even if I am holding my iphone in landscape and the views are in landscape. Is there no way to fix this?

If you've set your status bar orientation in applicationDidFinishLaunching and your view controllers are properly set up (overriding shouldAutorotateToInterfaceOrientation, etc) this should behave normally. If you could build for 2.2.1 and have verified that this is the case, please file a bug report. In the meantime one possible workaround is to rotate the view after it's been displayed in didPresentAlertView (though I've not heard of this since the 2.0 betas so I would double check my view controller related code).

-rob.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to