Juanpe / SkeletonView

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
MIT License
12.59k stars 1.11k forks source link

Issue with UICollectionView and SkeletonView's contentOffset #397

Closed ixopp closed 3 years ago

ixopp commented 3 years ago

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.

  1. Create a UICollectionView with a layout of UICollectionViewFlowLayout ( vertical )
  2. Set the skeletonable properties in a UICollectionViewCell
  3. Set the contentOffset to (top: 180, left: 25, bottom: 80, right: 20)
  4. Use showSkeleton, and then Hideskeleton after making/mocking a network request

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/80654289/120860545-d9163200-c553-11eb-8d0e-c8c7c39cdb58.mp4