开发者

iphone - How to control CALayer's shadow, exactly?

I am very new to CALayer thing. I had a look at the documentation, but quite don't understand the meaning of those properties which can be used to control the shadow

shadowOpacity

shadowRadius

shadowOffset

I particularly don't understand the Offset & Radius.

Can anyone give me some lights to me, for this newbie question?

Another question about the shadow is

If开发者_Go百科 the UIView view1's frame is CGRect(0, 0, 768, 40), if I apply shadow on it, will the shadow possibly be covered by another UIView which is just next to the bottom edge of view1?

thanks


The offset is how far the shadow is cast from its view. The radius is how blurry it is. You could set an offset that is zero CGSizeMake(0,0) and a radius of 5.0 and you would have an even shadow around your view.

Remember to import the QuartzCore library when trying to work with CALayers.

The shadow may be covered by views that are above it in the view heiarchy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜