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

IOS某个ViewController禁止自动旋转

2014-04-24 16:10 771 查看
IOS屏幕自动旋转,强制横竖屏方法:

- (BOOL)shouldAutorotate
{
return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskAll);
}

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


要注意的地方:

如果在subViewController中复写rotate相关的方法是不会起作用的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐