简体   繁体   English

Android ListView部分标题

[英]Android ListView section header

Are there any built-in ways for creating Android ListView section headers? 有没有内置的方法来创建Android ListView节标题? If not what is the easiest way for doing so, using XML markup as far as possible? 如果不是最简单的方法,尽可能使用XML标记?

No. You can make your own implementation or use a third-party library. 不可以。您可以自己实施或使用第三方库。 I suggest you to use this one in case you want them to stick at the top of the list: 我建议你使用这个,以防你希望它们粘在列表的顶部:

https://github.com/emilsjolander/StickyListHeaders https://github.com/emilsjolander/StickyListHeaders

You can add several headers using addHeaderView (View v) . 您可以使用addHeaderView(View v)添加多个标头。 Your views are then handled by a HeaderViewListAdapter 然后,您的视图由HeaderViewListAdapter处理

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

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