Why are all my masked views unmasked in my view snapshot?
Posted
by mystify
on Stack Overflow
See other posts from Stack Overflow
or by mystify
Published on 2010-04-19T10:19:24Z
Indexed on
2010/04/19
10:23 UTC
Read the original article
Hit count: 235
I'm taking a snapshot of an view. This view has got some subviews which have layer masks applied to them. For some reason, those masks take no effect in the snapshot and the masked parts are completely visible.
UIGraphicsBeginImageContext(theView.frame.size);
[theView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
I assume this is a bug in the framework. But maybe it's not? Did I do anything wrong here?
© Stack Overflow or respective owner