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

IOS6.0以后旋转的问题的处理

2013-03-20 16:10 429 查看
6.0以前用下面的这种方式
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return (toInterfaceOrientation != UIInterfaceOrientationMaskPortraitUpsideDown);
}
6.0以后要追加一下方式
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAllButUpsideDown;
}

UIInterfaceOrientationMaskLandscape 支持左右横屏
UIInterfaceOrientationMaskAll 支持四个方向旋转
UIInterfaceOrientationMaskAllButUpsideDown 支持除了UpsideDown以外的旋转

UIInterfaceOrientationPortrait 竖屏正常显示
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: