SectionIndexer中的getSectionForPosition()与getPositionForSection()

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

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

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

 

getSectionForPosition(0) 返回 0

getSectionForPosition(1) 返回 0

getSectionForPosition(2) 返回 0

getSectionForPosition(3) 返回 1

posted @ 2015-11-28 11:02  Leo的银弹  阅读(251)  评论(0编辑  收藏  举报