简体   繁体   English

将项目放在列表视图的顶部

[英]Keep an Item at the top of a list view

is there a way in android to make it so that an item or title type item sits at the top of the view of a list view? android中有没有一种方法可以使项目或标题类型的项目位于列表视图的顶部? I want a section title to sit at the top of the visible part of the list view until the next one comes to the top and replaces it. 我希望一个节标题位于列表视图的可见部分的顶部,直到下一个标题位于顶部并替换它为止。

Check out the PinnedHeaderListView and the android-amazing-listview projects. 检出PinnedHeaderListViewandroid-amazing-listview项目。 They both provider ListViews with pinned header capabilities. 它们都提供具有固定标头功能的ListView。

I suggest you use this library PinnedHeaderListView 我建议您使用此库PinnedHeaderListView

github.com/mldeng/PinnedHeaderListView github.com/mldeng/PinnedHeaderListView

This will definetely help you achieve exactly what you want. 这将绝对帮助您实现所需的目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM