I have three views on top of each other inside a superview.
superview
- subview 1 (CD Case)
- subview 2 (Artwork)
- subview 3 (Shine)
when I animate the alpha property of the superview it seams to affect the alpha of all subviews i.e. while the animation is running subview 1 the CD Case shines through the artwork.
While blending all three into one UIImage solves this problem, but for performance reasons this not really an option. (The views are display in a grid view and loaded on demand.)
Is there any other way to avoid this behaviour?
You can either reverse the fade, as suggested by @debleek63. Or you can change the
shouldRasterizeflag on the superviews layer.myView.layer.shouldRasterize = YESThis will make it use ‘group opacity’ and everything should composite as you’d expect. The first way is probably more performant, but not as ‘correct’.