sreezzz sreezzz - 1 year ago 180
Swift Question

how to get parallax icon effect on uicollectionview in tvos?

How can i add this parallax effect in uicollectionview

This parallax effect is only for app icons or we can add this effect to uicollectionview ?.

Answer Source

You have to create a layered image in .lsr format, as described here.

Then you load the created umage in an UIImageView (you have to create custom UICollectionViewCell which contains an image view).

After that, set adjustsImageWhenAncestorFocused property on the image view. You can do it in the Interface Builder or in code:

cell.imageView.adjustsImageWhenAncestorFocused = true