ios - UICollectionViewCell embedded in UITableViewCell changes scroll position when re-appears -
i have tableview cells having horizontal collection view. have multiple cells same style. let's tableview cells @ indices 0 & 5 have same style (i using same uitableviewcell subclass in dequeuereusablecellwithidentifier).
- user scrolls tableviewcell @ index 5. scrolls horizontal collection view leftwards(let's red-1 , yellow-2 cells hidden, cyan-3 leftmost).
- user scrolls tableviewcell @ index 0. although it's different uitableviewcell instance, collection view offset set same cell @ index 5.
in short, when i'm re-using tableview cells, content offset of scroll view inside uitableviewcell being set previous re-used cell.
is there someway can disable behaviour, each cell maintains it's own offset regardless of scroll activity on cell.
you can set cell confirm uiscrollviewdelegate , implement scrollviewdidenddecelerating method save scroll offset , use offset restore original offset when dequeue cell in cellforrowatindexpath of uitableview.
Comments
Post a Comment