gpt4 book ai didi

iphone - TableView :sectionForSectionIndexTitle:atIndex: for table footer/header

转载 作者:行者123 更新时间:2023-11-29 05:05:28 25 4
gpt4 key购买 nike

嘿,有什么巧妙的方法可以使用部分索引跳转到表页眉或页脚吗?我想要的是在索引顶部添加一个部分索引,跳转到页眉,在底部添加另一个部分索引,无需滚动即可跳转到页脚。

有什么想法吗?

最佳答案

我将在 UITableView 上使用以下方法滚动到正确的索引路径:- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition 动画:(BOOL)动画

使用 NSIndexPath 上的 + (NSIndexPath *)indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section 方法通过设置生成每个部分的索引路径row 为 0,section 从 0 运行到总的节数,可以从数据源中查询。

关于iphone - TableView :sectionForSectionIndexTitle:atIndex: for table footer/header,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5530747/

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