Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding shadow on all four sides of an UIImage iOS 6.0

Tags:

ios

shadow

I am trying to add a shadow to all four sides of a imageView. I see that: self.shadowView.layer.shadowOffset = CGSizeMake(10, 20); put a shadow on two sides. How do I put a shadow on all four sides?

like image 639
LarryB Avatar asked Apr 10 '13 01:04

LarryB


2 Answers

Just set shadowOffset to (0,0) or something close. Adjust shadowRadius if you want the shadow to be bigger. The default is 3 but you may have to increase it. You also may want to play with shadowOpacity to determine the visibility of the shadow.

like image 196
Seamus Campbell Avatar answered Oct 31 '22 20:10

Seamus Campbell


_yourImageView.layer.shadowRadius = 10.0;

This line plays the game. Try increasing your shadowRadius. Thus you will get the shadow on all 4 sides.

like image 3
Sudhin Davis Avatar answered Oct 31 '22 20:10

Sudhin Davis