IOS某个ViewController禁止自动旋转

IOS屏幕自动旋转,强制横竖屏方法:

复制代码
- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return (UIInterfaceOrientationMaskAll);// 修改这里 控制显示方向
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
复制代码
原文地址:https://www.cnblogs.com/yangmx/p/3915328.html