在我的应用程序中,我需要为我的ViewControllers.
ViewController1必须只支持横向。ViewController2必须支持横向+纵向。
我在 Summury 项目中启用了所有这样的方向:

所以,我将此代码插入ViewController1:
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
我将此代码插入ViewController2:
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
问题是它ViewController1也可以纵向旋转(它应该只支持横向)。
任何想法?
非常感谢大家!