Closed HexBlit closed 10 years ago
Do you mean that your section header including a Fragment ??
Yes I want to use a fragment for the sectionheader, It ends up being a child fragment, the sction header does sorting and filtering on its section's list adapter.
Do you have only one header or multiple headers? it sounds that you just need one sticky header at the top of listview. Is it? 在2014年08月20日 03:19,Michael A. Cameron写道: Yes I want to use a fragment for the sectionheader, It ends up being a child fragment, the sction header does sorting and filtering on its section's list adapter. — Reply to this email directly or view it on GitHub.
There are 4 different headers that do sorting or filtering
aha,i think that you can use a hashmap to cache the converview in getheaderview method.and then when sticky header changes, you can take the cached view out, remove your fragment from the cached view and then add it to current header view. what do you think of it? 发自邮箱大师 在2014年08月20日 03:25,Michael A. Cameron写道: There are 4 different headers that do sorting or filtering — Reply to this email directly or view it on GitHub.
Thanks, I ended up doing as you said, I had that idea earlier but the tricky part was that I had to continually remove the view from the parent as the parent in the getHeader was never really the same parent of the view from before.
Thanks.
@darxval The first header will be re-used. just not for the first sticky header but later on. You should not rely on headers being re-used either as this never a promise.
Hi I am trying to use these StickyHeaders with Fragments because I have a very complicated header system, in fact it is combined with Jeff Sharkey's multiple section implementation, using your library for the header of course. http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/
The problem I have is that if i use the getHeaderView to do the Fragment commit it shows up as the initial header. but as soon as you start to scroll it wants try and get the HeaderView again, but doesn't see that the initial header you just had is the one you want to reuse so convertView is null and you end up recommiting the transaction and get the Parent already has child view error.
In short, the library is not reusing the initial header view.