SectionIndexer接口中的getPositionForSection与getSectionForPosition
来源:互联网 发布:mac movist 破解 编辑:程序博客网 时间:2024/04/27 18:12
今天学习写联系人列表时遇到的问题-
对字母做索引
public int getPositionForSection(int section) {
// 通过首字母section对应显示的position位置// 循环遍历所有联系人数据
for(int i=0;i<contacts.size();i++){
//找到当次循环时,联系人名字的首字母
int ch=contacts.get(i).pinyin.toUpperCase(Locale.CHINA).charAt(0);
if(ch==section){
return i;
}
}
return 0;
}
public int getSectionForPosition(int position) {
//获取position位置对应的首字母section
return contacts.get(position).pinyin.toUpperCase(Locale.CHINA).charAt(0);
}
阅读全文
0 0
- SectionIndexer接口中的getPositionForSection与getSectionForPosition
- SectionIndexer中的getSectionForPosition()与getPositionForSection()解惑
- SectionIndexer中的getSectionForPosition()与getPositionForSection()解惑
- SectionIndexer中的getSectionForPosition()与getPositionForSection()解惑
- SectionIndexer中的getSectionForPosition()与getPositionForSection()解惑
- SectionIndexer中的getSectionForPosition()与getPositionForSection()解惑
- SectionIndexer中的getSectionForPosition()与getPositionForSection()解惑
- getPositionForSection与getSectionForPosition
- getSectionForPosition()与getPositionForSection()
- getPositionForSection与getSectionForPosition的用法(Listview分块显示)
- sectionIndexer
- SectionIndexer
- 在适配器中实现接口SectionIndexer
- SectionIndexer解析与使用 联系人侧边栏
- 侧边快速滑动搜索的SectionIndexer接口简单使用
- SectionIndexer详解
- XML中的SAX接口与DOM接口
- C++中的接口与实现
- Filter快速入门<转自黑马课堂笔记>
- Ember旅程系列(九) -- 构建一个比较复杂的组件
- 用supermin制作centos 7 docker 基础镜像
- 第三课 json的格式
- Windows8.1下安装VS2017需要安装KB2919335
- SectionIndexer接口中的getPositionForSection与getSectionForPosition
- 十四周 dynamic programming Minimum Path Sum
- js中对日期的扩展格式化
- 全排列 next_permutation()函数
- sciki learn 决策树学习笔记
- 机器人的运动范围dfs
- Story 32-33
- (搬运).net起步 (自定义 ASP.NET CreateUserWizard 控件1)
- 使用hexo+GitHub搭建自己的博客中遇到问题的解决方法及博客美化