简体   繁体   English

tvOS 中的“AVFocusProxyView”是什么? 遇到奇怪的焦点问题

[英]what is an `AVFocusProxyView` in tvOS? Getting a weird focus issue

what is an AVFocusProxyView ?什么是AVFocusProxyView When we show the AVContentProposal on top of a full screen player, AVFocusProxyView is hiding the accept/reject button .当我们在全屏播放器上显示AVContentProposal时, AVFocusProxyView隐藏了接受/拒绝按钮。 I am not able to move focus when this happens.发生这种情况时,我无法移动焦点。 And I am getting the following error on the UIFocusDebugger console :我在 UIFocusDebugger 控制台上收到以下错误:

图片

This is the error:这是错误:

  • Issue: The item is being visually occluded by the following items: AVFocusProxyView 0x149e22600问题:该项目在视觉上被以下项目遮挡:AVFocusProxyView 0x149e22600

How to fix this?如何解决这个问题? There is no documentation as well as google results about AVFocusProxyView .没有关于AVFocusProxyView文档和谷歌搜索结果。

在此处输入图片说明 AVFocusProxyView appears over the top of every button/views. AVFocusProxyView 出现在每个按钮/视图的顶部。

Solution for the focus issue that we face because of `AVFocusProxyView`.由于`AVFocusProxyView`而面临的焦点问题的解决方案。

We were unable to move the focus around because of the AVFocusProxyView overlay on top of the AVContentProposal .我们无法左右移动焦点,因为的AVFocusProxyView上的顶部覆盖AVContentProposal The fix was to add UIFocusGuide :修复方法是添加UIFocusGuide

view.addFocusGuide(anchorView: acceptButton, heading: .left   , sideSize: 80, targetFocus: rejectButton)
view.addFocusGuide(anchorView: rejectButton, heading: .right  , sideSize: 80, targetFocus: acceptButton)

Hidding the AVFocusProxyView fixed the issue for me.隐藏 AVFocusProxyView 为我解决了这个问题。 iterate through the subview and hide the AVFocusProxyView fixed the issue遍历子视图并隐藏 AVFocusProxyView 修复了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM