用的ListView滚动/固定标题行 [英] ListView with scrolling/fixed header rows

查看:105
本文介绍了用的ListView滚动/固定标题行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的,我想有一个ListView控件列出各种类别的数据。我想对于每个类别页眉/特殊行。

我也想它,以便同时通过该类别滚动标题行被固定为第一行。当滚动到达下一个类别新的头被固定,previous一位刚刚滚出屏幕。

一个简单的例子如下所示。直到我们达到标题2,然后取头1的位置等标题1是固定的。

我无法找到一个解决方案,因为我不太确定怎样称呼它..一个解决方案的任何想法将不胜AP preciated。谢谢你。

  ----------------------------
标题1
----------------------------
H1-项目
H1-项目
H1-项目
H1-项目
H1-项目
H1-项目
----------------------------
标题2
----------------------------
H2-项目
H2-项目
H2-项目
H2-项目
----------------------------
标题3
----------------------------
H3-项目
H3-项目


解决方案

您可能想看看的的 Android的部分名单的项目,这似乎是它的正是你想要在这里实现什么。

In Android I would like to have a ListView control that lists various categories of data. I would like a header/special row for each category.

I would also like it so the header row gets fixed as the first row while scrolling through that category. When scrolling reaches the next category the new header gets fixed and the previous one just scrolls off the screen.

A quick example is shown below. Header 1 is fixed until we reach Header 2 which then takes the place of Header 1 and so on.

I'm having trouble finding a solution for this as i'm not exactly sure what to call it.. any ideas on a solution would be greatly appreciated. Thanks.

----------------------------
Header 1
----------------------------
H1-Item
H1-Item
H1-Item
H1-Item
H1-Item
H1-Item
----------------------------
Header 2
----------------------------
H2-Item
H2-Item
H2-Item
H2-Item
----------------------------
Header 3
----------------------------
H3-Item
H3-Item

解决方案

You might want to take a look at the android-section-list project, which seems like it's exactly what you want to achieve here.

这篇关于用的ListView滚动/固定标题行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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