Is it possible to mask CALayer in iPhone?

Posted by Eonil on Stack Overflow See other posts from Stack Overflow or by Eonil
Published on 2010-04-30T08:18:29Z Indexed on 2010/04/30 8:27 UTC
Read the original article Hit count: 462

Filed under:
|
|

I'm trying to mask CALayer with a bitmap image. And I failed masking CALayer. My code is:

// 'PreloadViewController layerWithImageNamed' create a layer and set it's contents as specified UIImage.
CALayer* title = [PreloadViewController layerWithImageNamed:@"pinkhug_txt.png"];
 [[[self view] layer] addSublayer:title];

 CALayer* title_mask = [PreloadViewController layerWithImageNamed:@"hug_mask.png"];
 [title setMask:title_mask];

The Apple reference says "CALayer in iPhone does not support mask property". But there is a postings about this on SO. Is it possible? Or what's wrong with my code?

© Stack Overflow or respective owner

Related posts about calayer

Related posts about masking