//屏幕旋转
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
//进行自动旋转
-(BOOL)shouldAutorotate
{
return YES;
}
//设置在不同情况下支持的旋转方向
-(NSUInteger)supportedInterfaceOrientations
{
if (isFull) {
return UIInterfaceOrientationMaskLandscapeRight;
}else {
return UIInterfaceOrientationMaskPortrait;
}
}
//全屏时调用的方法
-(void)moviePlayerFullAction{
isFull = YES;
[self supportedInterfaceOrientations];
}
//返回时再改为竖屏
-(void)moviePlayerBack{
isFull = NO;
}视频播放时强制横屏
最新推荐文章于 2021-06-05 03:47:26 发布
本文探讨了如何在iOS应用中实现屏幕旋转功能,包括自动旋转的设置、不同情况下的支持旋转方向,以及全屏与非全屏状态的切换策略。
1万+

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



