模拟器中的iOS 6自动旋转与实际的iOS 6设备不同 [英] iOS 6 autorotation in simulator varies from actual iOS 6 device

查看:116
本文介绍了模拟器中的iOS 6自动旋转与实际的iOS 6设备不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序不会在iOS 6 GM模拟器中自动旋转,但它会在设备上使用相同版本的iOS。这可能是一个模拟器错误吗?该应用程序正在使用已弃用的自动旋转方法,但它们在设备本身上工作正常,这让我想知道模拟器API是否不同?

My app will not autorotate in the iOS 6 GM simulator but it does with the same version of iOS on the device. Could this be a simulator bug? The app is using deprecated autorotation methods, but they are working fine on the device itself which makes me wonder if the simulator APIs are different?

推荐答案

这是我为了让我的应用再次运行而添加的内容:

This is what I added to get my app working again:

// Tell the system what we support
- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAllButUpsideDown;
}

// Tell the system It should autorotate
- (BOOL) shouldAutorotate {
    return YES;
}

// Tell the system which initial orientation we want to have
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

这篇关于模拟器中的iOS 6自动旋转与实际的iOS 6设备不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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