Saturday, 30 June 2018

Adjust collectionView.scrollToItem to consider inset?

I'm sometimes scroll to the left of a cell like this:

collectionView.scrollToItem(
    at: IndexPath(row: 5, section: 0),
    at: .left, // TODO: Left ignores inset
    animated: true
)

This is how it starts out before scrollToItem implemented:

enter image description here

However, when I try to use scroll to item, it sticks the cell to the edge instead of considering the inset:

enter image description here

Is there an easy way to fix collectionView.scrollToItem to accommodate the insets?



from Adjust collectionView.scrollToItem to consider inset?

No comments:

Post a Comment