应用程序仅在iOS 6中旋转,而不在iOS 5中旋转 [英] App only rotates in iOS 6 and not in iOS 5

查看:114
本文介绍了应用程序仅在iOS 6中旋转,而不在iOS 5中旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了针对iOS 5和iOS 6的应用程序,出于某种原因,它仅在iOS 6设备上使用时才会旋转,在iPhone或iPad上使用,并且不会在使用iOS 5的设备上旋转我的应用程序是通用的。请帮我解决这个问题!谢谢

I have made an app targeted for iOS 5 and iOS 6, and for some reason it only rotates when using it on devices with iOS 6, wether on an iPhone or an iPad, and doesn't rotate on devices using iOS 5. My app is universal. Please help me resolve this problem! Thanks

推荐答案

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return ((toInterfaceOrientation == UIInterfaceOrientationPortrait) || (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown));
}

- (NSUInteger)supportedInterfaceOrientations
{
    return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}

覆盖所有uiviewcontroller子类中的这两个方法......这个将适用于ios 6及更早版本

overide these two methods in your all uiviewcontroller subclasses ...... this will work for ios 6 and earlier

这篇关于应用程序仅在iOS 6中旋转,而不在iOS 5中旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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