Closed ananth10 closed 4 years ago
What does your layout hierarchy look like? Also could you post or summarize the XML for your item view that is sticky?
The view that is used as a sticky header is created the same way the RecyclerView creates it, by calling onCreateViewHolder
on your adapter, followed by onBindViewHolder
. The view from your view holder is then added to the parent of the RecyclerView.
This is why there is sometimes a need to wrap your RecyclerView that will have sticky headers in a FrameLayout. If your RecyclerView is a child that isn't the full width of the parent, this may happen (though a bit confused on the height filling out).
This was happening for me while inflating ViewHolder's itemView like such:
LayoutInflater.from(parent.context).inflate(layoutResId, null)
It got fixed when I did this:
LayoutInflater.from(parent.context).inflate(layoutResId, parent, false)
Closing due to no updates from reporter.
Thanks @chetdeva for a potential reason this could be happening.
Please reopen with a way to verify a repro of the issue if needed.
Hi ,
I am trying to implement your sticker header library. i have done everything. but when i do scroll up the sticky header background color covers whole recyclerview. please check attached screenshot and let me whats wrong in this.