"分离器"在ListView控件

编程入门 行业动态 更新时间:2024-10-27 02:19:32
本文介绍了"分离器"在ListView控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 ArrayAdapter 这是迷上了我的的ListView 。我真的很喜欢在Evernote的Andr​​oid应用程序,在那里他们分开使用邮戳项目分隔符功能:

I have an ArrayAdapter which is hooked up to my ListView. I really like the "separators" feature in the Evernote Android application, where they separate items using a datestamp:

我想他们在做什么是具有立即被设置为当前的分离器的价值,因为你可以在屏幕看到列表上方的视图。 (当你滚过一个分离器,在顶部的文本设置为当前的分离,即2011年1月的值),我将如何实际插入分离到我的的ListView ?

I assume what they're doing is having a view immediately above the list which is set to the value of the current separator, as you can see in the screenshots. (As you scroll past a separator, the text at the top is set to the value of the current separator, ie "January 2011") How would I actually insert the separators into my ListView?

推荐答案

一个分隔符是一个简单的禁用列表项,只是你的适配器返回分离器,它应该是。好像SectionIndexer能有所帮助。

A separator is simply a disabled list item, just have your Adapter return the separator where it should be. Seems like SectionIndexer could help.

更多推荐

"分离器"在ListView控件

本文发布于:2023-11-25 07:27:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628857.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   分离器   QUOT   ListView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!