reactjs - Which SectionHeader is Sticky in react-native? -
i'm using react-native's sectionlist component implement list sticky section headers. i'd apply special styling whichever section header sticky.
i've tried 2 methods determine sticky header "sticky," , neither have worked:
- i tried use each section header's
onlayoutprop determine each of y offsets, , use in combinationsectionlistonscrollevent calculate section header "sticky". - i tried use
sectionlist'sonviewableitemschangedprop figure out header sticky.
approach #1 doesn't work because event object passed onlayout callback contains nativeevent height , width properties. approach #2 doesn't work because onviewableitemschanged callback appears invoked inconsistent data (initially, first section header marked viewable (which is), then, once becomes "sticky," marked not viewable, , further scrolling inexplicable marked viewable again while still "sticky" [this final update seems arbitrary]).
anyone know solution works?
Comments
Post a Comment