Android7.0中文文档(API)-- SectionIndexer

来源:互联网 发布:徐培成大数据怎么样 编辑:程序博客网 时间:2024/06/07 02:09

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/SectionIndexer.html

SectionIndexer

public interface SectionIndexer

android.widget.SectionIndexer
已知的间接子类


Interface that may implemented on Adapters to enable fast scrolling between sections of anAbsListView.
可以在Adapter上实现的接口,以便在AbsListView的各section之间快速滚动。

A section is a group of list items that have something in common. For example, they may begin with the same letter or they may be songs from the same artist.
section是有共同之处的列表项一个组。例如:它们可能开始与相同的字母,也可能是同一名艺术家的曲目。

ExpandableListAdapters that consider groups and sections as synonymous should account for collapsed groups and return an appropriate section/position.
ExpandableListAdapter将组和section视为相同的,其用于已折叠的组,并返回适当的section/位置。

See also:
另请参考:

  • setFastScrollEnabled(boolean)

摘要


Public方法

abstract intgetPositionForSection(int sectionIndex)

Given the index of a section within the array of section objects, returns the starting position of that section within the adapter.
指定section对象的数组中的section索引,返回适配器中section的起始位置。

abstract intgetSectionForPosition(int position)

Given a position within the adapter, returns the index of the corresponding section within the array of section objects.
指定适配器中的位置,返回对应的section对象的数组中的section索引。

abstract Object[]getSections()

Returns an array of objects representing sections of the list.
返回对象数组,用于显示列表的section。

Public方法


getPositionForSection

API level 3版本中可用
int getPositionForSection (int sectionIndex)

Given the index of a section within the array of section objects, returns the starting position of that section within the adapter.
指定section对象的数组中的section索引,返回适配器中section的起始位置。