SectionIndexer中的getSectionForPosition()与getPositionForSection()

大家在做字母索引的时候常常会用到SectionIndexer这个类,里面有2个重要的方法

1.   getSectionForPosition()通过该项的位置,获得所在分类组的索引号

2. getPositionForSection()       根据分类列的索引号获得该序列的首个位置

getSectionForPosition(0) 返回 0

getSectionForPosition(1) 返回 0

getSectionForPosition(2) 返回 0

getSectionForPosition(3) 返回 1

原文地址:https://www.cnblogs.com/krislight1105/p/5002331.html