Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 43  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Forcing UIAlertView into landscape mode
  2. -(void) willPresentAlertView:(UIAlertView *)alertView {
  3.  
  4.     alertView.transform = CGAffineTransformMakeRotation(M_PI_2);
  5. }
  6.        
  7. - (void)didPresentAlertView:(UIAlertView *)alertView
  8. {
  9.     // UIAlertView in landscape mode
  10.     [UIView beginAnimations:@"" context:nil];
  11.     [UIView setAnimationDuration:0.1];
  12.     alertView.transform = CGAffineTransformRotate(alertView.transform, 3.14159/2);
  13.     [UIView commitAnimations];
  14. }
  15.        
  16. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  17. {
  18.     return YES; /* auto rotate always */
  19. }
  20.        
  21. [[UIApplication sharedApplication] setStatusBarOrientation:theOrientation];