Not able to acomplish Sticky header
See original GitHub issueI did all the steps according to the wiki and the demo but the headers are not sticking at all. The sections are fine but the header scrolls out of the page @davideas What else I should try?
Obs:
-
‘eu.davidea:flexible-adapter:5.0.0-b8’
-
Using the same fragment_recycler_view.xml
-
HeaderItem extends AbstractHeaderItem<HeaderItem.HeaderViewHolder>
-
Item extends AbstractFlexibleItem<Item.ItemViewHolder> implements ISectionable<Item.ItemViewHolder, HeaderItem>
adapter = new FlexibleAdapter<>(items);
recycler.setLayoutManager(new SmoothScrollLinearLayoutManager(getContext()));
adapter.setDisplayHeadersAtStartUp(true);
adapter.enableStickyHeaders();
recycler.setAdapter(adapter);
recycler.setHasFixedSize(true);
recycler.setItemAnimator(new DefaultItemAnimator());
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
position:sticky is not working - Stack Overflow
.header has a height of 150px. .navbar has a height of 20px. When the user scrolls, I want .navbar to stick at the...
Read more >Lightning Web Component Sticky Header - Not able to global ...
I have defined sticky2 to class for a sticky header. Js controller /* eslint-disable no-console */ import { LightningElement } from 'lwc'; ...
Read more >Header Sticky does not work (Pro) - WordPress.org
The header is currently sticky because of my custom CSS–the header sticky customizer option still isn't working. And neither is the scroll to...
Read more >Stop Using Fixed Headers and Start Using Sticky Ones
By using position: fixed on an element like the header, the element is removed from the stack and positioned relative to the browser...
Read more >Sticky Headers: 5 Ways to Make Them Better
1. Maximize the Content-to-Chrome Ratio by Keeping It Small. Sticky headers inherently take up space on the screen that could be used for ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davideas Found it! I was implementing this method wrong. Now it works!
@leodeleon22, I see now that, you enable the headers before setting the Adapter. Move the assignment after. The layout needs the RV attached (means not null) before inflating the sticky container.
Be aware that I’m going to change this configuration, in the next pre-release.