您的位置:首页 > 移动开发 > IOS开发

iOS6下无法调用设备转向方法的原因及解决方案

2012-10-24 11:55 197 查看
在iOS6下,以下设备转向用的方法已废弃:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
}


iOS6使用了新的方法代替:

- (BOOL)shouldAutorotate {
return NO;
}

- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationPortrait;
}


 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐