gpt4 book ai didi

uitableview - tvOS UITableView 单元格聚焦

转载 作者:行者123 更新时间:2023-12-02 11:25:26 25 4
gpt4 key购买 nike

我正在寻找 UITableView 的回调函数当我使用 Apple Remote 导航并按向上或向下键选择行时(而不是按 Enter 键时),当该行聚焦时。

在 iOS 上,我们有 didSelectRowAtIndexPath这在用户选择行时调用,但我找不到用户在 UITableView 中导航时调用的函数.

最佳答案

您必须实现此委托(delegate)方法:

- (void)tableView:(UITableView *)tableView didUpdateFocusInContext:(UITableViewFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
{
//this gives you the indexpath of the focused cell
NSIndexPath *nextIndexPath = [context nextFocusedIndexPath];
}

然后你可以在那个函数中做任何你想做的事情

关于uitableview - tvOS UITableView 单元格聚焦,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33048065/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com