简体   繁体   English

tvos uicollectionview相对焦点

[英]tvos uicollectionview relative focus

Hello and thank you in advance for your help. 您好,并提前感谢您的帮助。

I'm learning tvOS and facing an issue related to the focus when navigating b/w the rows of a tableview. 我正在学习tvOS,并且在浏览桌面视图行时遇到与焦点相关的问题。 Each UItabelviewcell has an embedded collectionview. 每个UItabelviewcell都有一个嵌入式集合视图。

for ex: if the focus is on the 3rd cell of of the 1st collectionview, swiping down to another row should keep you at the same index 3. Instead the focus jumps to the first cell of the collectionview for the second uitableviewcell. 例如:如果焦点位于第一个集合视图的第三个单元格上,则向下滑动到另一行应该使您保持相同的索引3.相反,焦点会跳转到第二个uitableviewcell的集合视图的第一个单元格。

Are there any properties I can use to achieve the expected behavior described in the image attached? 是否有任何属性可用于实现附加图像中描述的预期行为?

在此输入图像描述

That is because remembersLastFocusedIndexPath value is set to TRUE inside the collectionView of each TableViewCell. 这是因为remembersLastFocusedIndexPath值在每个TableViewCell的collectionView中设置为TRUE。

myCollectionView.remembersLastFocusedIndexPath = false

This will make sure the focus works as expected. 这将确保焦点按预期工作。

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

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