cfisher cfisher - 1 year ago 94
Objective-C Question

Forcing UIAlertView into landscape mode

I need to display a UIAlertView in landscape mode. I tried the obvious, setting the transform in the

delegate method to no avail:

-(void) willPresentAlertView:(UIAlertView *)alertView {

alertView.transform = CGAffineTransformMakeRotation(M_PI_2);

Any suggestions on how to fix this?

Answer Source

Have you tried in the didPresentAlertView?

- (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];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download