![](/img/trans.png)
[英]tvOS: How to Handle Focus Change between TabBar and UICollectionView and Prevent Crashing
[英]tvos how to prevent AVPlayerViewController from gaining focus
有沒有辦法阻止tvOS上的AVPlayerViewController獲得焦點?
由於我們不能過度重視並將其作為視圖控制器或委托來實現,因此無法實現canBecomeFocused或shouldUpdateFocusInContext
有任何想法嗎?
把Juraj的答案放在代碼中:
playerViewController.view.isUserInteractionEnabled = false
這些方面的東西可以幫助你:
func createPlayer() -> AVPlayerViewController {
let player = AVPlayerViewController()
player.view.frame = viewFrame
player.showsPlaybackControls = false
player.view.isUserInteractionEnabled = false
return player
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.