문제

I have a CALayer subclass. I have overridden the drawInContext method. I want the majority of my layer to be transparent except a few areas. I'm using the layer as a menu and I want the icons and labels on the menu to be opaque.

Is it possible to have a CALayer's sublayers be opaque if the super CALayer is transparent?

Is it possible to draw opaque tems in the drawInContext method of a transparent CALayer? I have tried using CGContextSetAlpha, but I assume it doesn't work since the CALayer that I am drawing for is transparent.

As always, any help would be great.

도움이 되었습니까?

해결책

I found out that it is possible. A super layer does not dictate the transparency of its sublayer.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top