Closed az0r234 closed 3 years ago
I couldn't reproduce the problem with a CollectionView (I think you mean contentInset when you say contentOffset), but I recently had the same problem with a TableView and fixed it by setting isScrollEnabled = true on the TableView immediately after calling the showSkeleton method.
@harrisonsj, I actually tried that, and yes I did mean contentInset. However, it doesn't seem to work with UICollectionView. It's a really annoying bug, but the temporary solution right now for me is to change the contentInset manually.
I figured out a better solution. I believe every-time that the showSkeleton method is being called, it readjusts the contentInset for UICollectionView, and with that also readjusts the content area of the scrollview. To fix it, what I did was set the contentAdjustmentBehavior for collectionView to .never:
collectionView.contentAdjustmentBehavior = .never
Description
Describe your issue here.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
SkeletonView Environment:
SkeletonView version: 1.16.0 Xcode version: Version 12.5 (12E262) **Swift version: 5.0
Steps to reproduce:
Please replace this with the steps to reproduce the behavior.
Expected result:
Please replace this with what you expected to happen. It was supposed to just stay in place and show the skeleton animation.
Actual result:
Please replace this with of what happened instead.
However, I'm getting a weird result. The collectionView is shifted upwards by about 30-40 points, and then once skeleton is stopped it moves back to the intended position. It's as if skeletonView is overriding the contentOffset value that I originally set.
Attachments:
Logs, screenshots, sample project, funny gif, etc.
https://user-images.githubusercontent.com/20172446/120860752-2eeada00-c554-11eb-9c0d-9f640f198207.mp4