tableView的重点是什么:sectionForSectionIndexTitle:atIndex:? [英] What exactly is the point of tableView:sectionForSectionIndexTitle:atIndex:?

查看:154
本文介绍了tableView的重点是什么:sectionForSectionIndexTitle:atIndex:?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档对此并不十分清楚。为什么要求UITableViewDataSource提供索引栏节标题的节索引?

The documentation is not really clear about this. Why is the UITableViewDataSource asked to provide the section index for an index-bar section title?

我的意思是......哪些用例使这个方法很重要?何时被调用以及为什么?

I mean... what use cases make this method important? When is this called and why?

推荐答案

基本上,它定义了当您单击指定的部分时表视图滚动到哪个部分索引标题。假设您将索引标题定义为字母A到Z,但实际上每个字母都没有项目。在 -tableView:sectionForIndexTitle:atIndex:中,您可以指定包含项目的 next 部分。

Basically, it defines which section the table view scrolls to when you click on the specified section index title. Let's say you define your index titles as the letters A through Z, but you don't actually have items for each letter. In -tableView:sectionForIndexTitle:atIndex:, you would specify the next section that has an item.

这篇关于tableView的重点是什么:sectionForSectionIndexTitle:atIndex:?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆