【问题标题】:Can't dismiss AVPlayerViewController in iOS16无法在 iOS16 中关闭 AVPlayerViewController
【发布时间】:2022-11-01 13:48:16
【问题描述】:

由于 iOS 16 对 AVPlayerViewController 进行了更改,因此左上角的关闭按钮 ('x') 根本不起作用。 “点击”是正常的,但感觉 UIButton 目标什么也没做。我觉得我错过了一些明显的东西。是否需要使用委托方法或设置才能使其工作?在 iOS 16 之前,这一切都运行良好。实现如下:

AVPlayerViewController *vc = [[AVPlayerViewController alloc] init];
vc.player = [AVPlayer playerWithURL:[NSURL URLWithString:videoInfo.VideoURL]];
vc.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:vc animated:NO completion:nil];

【问题讨论】:

    标签: avplayerviewcontroller ios16


    【解决方案1】:

    打开动画修复它,但我不知道为什么

    [self presentViewController:vc animated:YES completion:nil];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-26
      • 2022-11-30
      • 1970-01-01
      • 2022-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-12
      相关资源
      最近更新 更多