简体   繁体   English

将页眉或页脚视图添加到Endless Adapter的工作解决方案

[英]Working solution for adding header or footer view to Endless Adapter

i'm searching for a solution for adding header / footer views to Endless Adapter. 我正在寻找为Endless Adapter添加页眉/页脚视图的解决方案。 I've done many tries but with no luck. 我做了很多尝试,但是没有运气。 Can someone post a simple working code? 有人可以发布简单的工作代码吗? Thanks! 谢谢!

I would expect an EndlessAdapter wrapped around a MergeAdapter would work for headers added via the MergeAdapter . 我希望包裹在EndlessAdapter周围的MergeAdapter可以用于通过MergeAdapter添加的标头。 Footers, though, you cannot use with EndlessAdapter , period, as the footer would mess up EndlessAdapter 's "we got to the end" logic. 但是,页脚不能与EndlessAdapter句号一起使用,因为页脚会弄乱EndlessAdapter的“我们到了尽头”逻辑。 You would need to create your own "endless" solution for that. 您将需要为此创建自己的“无尽”解决方案。

Note that this refers to headers and footers that are designed to scroll with the contents. 请注意,这是指旨在与内容一起滚动的页眉和页脚。 If you want fixed headers and footers, those are simply views outside the ListView , using a vertical LinearLayout or something to sequence them appropriately. 如果您需要固定的页眉和页脚,则它们只是ListView之外的视图,可以使用垂直的LinearLayout或适当的顺序对其进行排序。

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

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