
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.67 KB | hits: 43 | expires: Never
Forcing UIAlertView into landscape mode
-(void) willPresentAlertView:(UIAlertView *)alertView {
alertView.transform = CGAffineTransformMakeRotation(M_PI_2);
}
- (void)didPresentAlertView:(UIAlertView *)alertView
{
// UIAlertView in landscape mode
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationDuration:0.1];
alertView.transform = CGAffineTransformRotate(alertView.transform, 3.14159/2);
[UIView commitAnimations];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES; /* auto rotate always */
}
[[UIApplication sharedApplication] setStatusBarOrientation:theOrientation];