I'm working an an iPad update and I'm using the UIAlertView to present some information. Following on the following notifications, I've got the Cocos2D elements and screens rotating correctly.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:@"UIDeviceOrientationDidChangeNotification" object:nil];
- (void) orientationChanged:(NSNotification *)notification
{
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
// Bail out if the orientation should be ignored
if (orientation == UIDeviceOrientationUnknown||orientation == UIDeviceOrientationFaceDown||orientation == UIDeviceOrientationFaceUp) return;
[[CCDirector sharedDirector] setDeviceOrientation:(ccDeviceOrientation)orientation];
}
I tried playing around with setting the alertview's transform property, with no real success since the application can launch in any orientation and rotate to any orientation. Has anyone had success with keeping an alert always in the correct rotation regardless of the device orientation?
Thanks,
Derek