renzifeng/ZFPlayer

iOS16以下系统windwos遮挡问题

lcyisgod opened this issue · 2 comments

在iOS16以下系统横屏情况下ZFLandscapeViewController_iOS15会遮挡系统windows

方法一:在ZFPortraitControlView164行找到下面方法

  • (void)fullScreenButtonClickAction:(UIButton *)sender {
    if(ISLandscape){ //当前是横屏,手动调整屏幕全屏。(判断当前是横屏的方法自己百度)
    [self.player rotateToOrientation:UIInterfaceOrientationLandscapeRight animated:YES];//当前方向和旋转方向相反,否则没有响应
    return;
    }
    [self.player enterFullScreen:YES animated:YES];
    }

方法二:找到ZFLandscapeRotationManager_iOS15.m第61行,添加一行代码:

  • (void)interfaceOrientation:(UIInterfaceOrientation)orientation completion:(void(^ __nullable)(void))completion {
    ...
    if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
    ...
    }
    [self.landscapeViewController viewWillTransitionToSize:self.landscapeViewController.view.frame.size withTransitionCoordinator:self.landscapeViewController.transitionCoordinator];
    [UIViewController attemptRotationToDeviceOrientation];
    }