强制UIAlertView进入横向模式 [英] Forcing UIAlertView into landscape mode

查看:126
本文介绍了强制UIAlertView进入横向模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在横向模式下显示UIAlertView。我尝试了显而易见的,在 willPresentAlertView:委托方法中设置转换无效:

I need to display a UIAlertView in landscape mode. I tried the obvious, setting the transform in the willPresentAlertView: delegate method to no avail:

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

    alertView.transform = CGAffineTransformMakeRotation(M_PI_2);
}

有关如何解决此问题的任何建议吗?

Any suggestions on how to fix this?

推荐答案

您是否在 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];
}

这篇关于强制UIAlertView进入横向模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆