Open graisVictory opened 5 years ago
It's a bit late but I was getting all sorts of weird behavior when the my recyclerview
was set to android:layout_height="wrap_content"
. All the issues went away when I swapped to android:layout_height="match_parent"
. I had my recyclerview as a child in a relative layout.
My issue was that that onCreateHeaderViewHolder
and onBindHeaderViewHolder
were being called but the view wasn't showing. Just an empty view, of the correct size, where it should have been. Strangely the last several stickyHeaders would show up.
@graisVictory did you figure this out? I'm getting the same behavior: The callbacks are called but only the last header is correct. The other ones are blank and much too tall. I don't think it's related to @maroney-tm's solution because my layout_weight="1"
, meaning that the height shouldn't depend on content.
Okay found the problem in my case: The list view hadn't been laid out yet, so any header on-screen initially got laid out wrong.
The issue reproduces periodically without any rules. onCreateHeaderViewHolder and onBindHeaderViewHolder gets called, but headers are not visible My code looks like
and xml:
But no matter what font or any other style (even without any style) I'm using - result is the same. Note that I'm using this recycle view https://github.com/myinnos/AlphabetIndex-Fast-Scroll-RecyclerView Help me please :(