Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

solid shadow for CALayer

I have an animated CALayer which is dropping a shadow. That is what I intended to do but I am looking for way to have a solid shadow without blur. Changing the blur radius does not save my problem. Any ideas?

Many thanks.

    myLayer.shadowRadius = 3;
    //shadowBlurRadius
    myLayer.shadowColor = [[UIColor greenColor] CGColor];
    //intended is to get a green solid shadow without blur
like image 808
user1612877 Avatar asked Feb 12 '13 23:02

user1612877


1 Answers

If you want no blurring, you can:

myLayer.shadowColor = [[UIColor greenColor] CGColor];
myLayer.shadowOffset = CGSizeMake(5.0, 5.0);
myLayer.shadowOpacity = 1.0;
myLayer.shadowRadius = 0.0;

The shadowRadius dictates the amount of blur. shadowOffset dictates where the shadow goes.

like image 135
Rob Avatar answered Nov 15 '22 19:11

Rob