The problem is: after scrolling the collectionView and clicking on an item another viewController is presented via navigationController. When I tap on the 'Back' button (top-left) the collection view scrolls to top, but I want it to keep the "scroll position" that it had before changing view controller.
I tried adding
automaticallyAdjustsScrollViewInsets = false
Thank you
答案 0 :(得分:0)
automaticallyAdjustsScrollViewInsets
has nothing to do with what you are dealing with.
The collectionView should not scroll back to top by itself. You are probably calling reloadData()
in viewDidAppear
or viewWillAppear
which triggers the behavior you are describing.