Solid shadow for CALayer

I have an animated CALayer that casts a shadow. This is what I intended to do, but I am looking for a 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 
+7
source share
1 answer

If you do not want blur, you can:

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

shadowRadius determines the amount of blur. shadowOffset determines where the shadow goes.

+22
source

All Articles