鈿狅笍 Please fill out this template when filing an issue.
I am trying to show skeleton in collection view , i added an image view and a label to a cell set them both skeletonable and also set the cell to skeletonable and in viewDidLoad called showAnimatedGradientSkeleton() on collectionView.
I thought it should show the collectionView cells as skeleton.
but it shows the whole collection view as skeleton and the cells dont appear, basically i just have a gray view with a gradient animation showing up.
Add a collection view , add a cell to it , add imageview and label to cell set isSkeletonable to true
for all of them. Implement the protocol and then run
SkeletonView version: 1.2.1
Xcode version: 9.3.1
Swift version: 4.0

Please help me with this, it works on the UItableView if i set the EstimatedRowHeight but since UICollectionView does not have any such property i couldn't resolve it. I also tried the sizeForItem method but it doesnt work also.
wow ! i just wasted a couple of hours for this and a dispatch of 0.1 sec resolved the issue.
Doesn't work for me:

That's how my request to show gradient looks like:
@samsidd Hey I seem to have the same issue as you used to have. I wonder what does it mean by a dispatch of 0.1 sec?
I have the same problem
+1
The solution for me was to add in file SkeletonView.swift:
DispatchQueue.main.async after addDummyDataSourceIfNeeded() to fileprivate func recursiveShowSkeleton(withType type: SkeletonType, usingColors colors: [UIColor], animated: Bool, animation: SkeletonLayerAnimation?)
But I still have an issue with blinking content before skeleton appears
Hi, this issue should be solved in latest version (1.3).
You need to prepareSkeleton, you can check this PR (https://github.com/Juanpe/SkeletonView/pull/42)
still not fixed using 1.4
still not fixed
You can achieve with
collectionView.prepareSkeleton { [weak self] (done) in
if let visibleCells = self?.collectionView.visibleCells {
for cell in visibleCells {
cell.contentView.showAnimatedSkeleton()
}
}
}
Still not fixed
@Juanpe please fix this ASAP. Temporarly I use saxahan's code to make it working. @saxahan thanks :)
SkeletonView v1.5
still doesn't work
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Doesn't work in tableviewcell too.
Most helpful comment
You can achieve with