-(void)setOrientation:(UIDeviceOrientation)orientation{
_orientation = orientation;
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:orientation] forKey:@"orientation"];
}
各方面的设置都没有问题,最后发现是该视图是通过self presentViewController展示的
最后改为通过pushViewController 就ok了
本文介绍了一种在iOS开发中遇到的方向设置问题及其解决方案。问题出现在使用self.presentViewController展示视图时,通过修改为pushViewController方法成功解决了方向设置不生效的问题。
691

被折叠的 条评论
为什么被折叠?



