在iOS 7中显示UIAlertView时的旋转问题 [英] rotation problems when a UIAlertView is showing in iOS 7

查看:82
本文介绍了在iOS 7中显示UIAlertView时的旋转问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS7中,很少但很偶然,当我在显示 UIAlertView 时旋转我的应用程序时,只有alertView和状态栏旋转,而不是我的应用程序。有没有其他人经历过这个和/或找到了解决方法?

in iOS7, rarely but occassionally, when I rotate my app while a UIAlertView is showing, only the alertView and the status bar rotate, and not my app. Has anybody else experienced this and/or have found a workaround?

推荐答案

我已经通过添加下一个方法解决了这个问题app delegate:

I've resolved this issue by adding the next method to app delegate:

- (void)application:(UIApplication *)application willChangeStatusBarOrientation:(UIInterfaceOrientation)newStatusBarOrientation duration:(NSTimeInterval)duration  {
NSArray *windows = [application windows];
for (UIWindow *nextWindow in windows) {
    [[nextWindow.rootViewController class] attemptRotationToDeviceOrientation];
     }
}

这篇关于在iOS 7中显示UIAlertView时的旋转问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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