在Recyclerview中按Android字母顺序显示每个字母下的显示名称列表 [英] Display Namelist In Recyclerview under each letter in alphabetic Order Android

查看:456
本文介绍了在Recyclerview中按Android字母顺序显示每个字母下的显示名称列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个联系人列表,必须按字母顺序显示在每个字母下,如图所示.

I have list of contacts which has to be displayed in alphabetic under each alphabet as shown in the image shown

如何在RecyclerView中执行此操作,请提出解决方案.谢谢

How can I do this in RecyclerView, please suggest a solution.thanks

推荐答案

  1. 按名称对数据进行排序
  2. 通过列表遍历数据,并在当前项目的第一个字母!=下一个项目的第一个字母到位时,插入特殊的对象.
  3. 当项目为特殊"时,在您的Adapter地方放置特殊视图.
  1. Sort list with data by name
  2. Iterate via list with data, and in place when current's item first letter != first letter of next item, insert special kind of object.
  3. Inside your Adapter place special view when item is "special".

这篇关于在Recyclerview中按Android字母顺序显示每个字母下的显示名称列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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