1.将4个勾勾上 默认控制器view都能4方向旋转 如需做特定旋转方向 执行第二步
//禁止旋转
- (BOOL)shouldAutorotate
{
return NO;
}
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
/*以home键为准上下左右
UIInterfaceOrientationMaskPortrait 正常状态 home键在下
UIInterfaceOrientationMaskPortraitUpsideDown 从下旋转 home键在上
UIInterfaceOrientationMaskLandscapeLeft home键在左面
UIInterfaceOrientationMaskLandscapeRight home键在右面
UIInterfaceOrientationMaskLandscape 支持左和右旋转
UIInterfaceOrientationMaskAllButUpsideDown 支持正常和左右旋转
UIInterfaceOrientationMaskAll 支持4个方向旋转
{
/*以home键为准上下左右
UIInterfaceOrientationMaskPortrait 正常状态 home键在下
UIInterfaceOrientationMaskPortraitUpsideDown 从下旋转 home键在上
UIInterfaceOrientationMaskLandscapeLeft home键在左面
UIInterfaceOrientationMaskLandscapeRight home键在右面
UIInterfaceOrientationMaskLandscape 支持左和右旋转
UIInterfaceOrientationMaskAllButUpsideDown 支持正常和左右旋转
UIInterfaceOrientationMaskAll 支持4个方向旋转
*/
return UIInterfaceOrientationMaskLandscapeRight;
}