开发者

tableView:sectionForSectionIndexTitle:atIndex: for table footer/header

Hey, 开发者_如何学GoAny clever way to jump to table header or footer with section indices? What I want is to add a section index at the top of the indices that jumps to header and another one at the bottom that brings you to footer without having to scroll.

Any ideas?


I would use the following method on UITableView to scroll to the correct index path: - (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated.

Use the + (NSIndexPath *)indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section method on NSIndexPath to generate an index path to each section start by setting the row to 0 and the section runs from 0 to the total number of sections, which can be asked from the data source.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜