Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective C: How to add Shadow effect to navigation bar and table cells [duplicate]

Possible Duplicate:
How to use Quartz 2D to add drop shadow to an UIImage or UIImageView ?

Hi,

I have created a tableViewController and want to try to add the shadow effect for both the navigation bar as well as the table cells. Can anyone guide me on the approach to do so?

Thanks!

Zhen Hoe

like image 328
Zhen Avatar asked May 16 '11 04:05

Zhen


1 Answers

try this

yourView.layer.shadowColor = [[UIColor blackColor] CGColor];
yourView.layer.shadowOffset = CGSizeMake(1.0f, 1.0f);
yourView.layer.shadowRadius = 3.0f;
yourView.layer.shadowOpacity = 1.0f; 

You'll need to replace "yourView" with nav bar or table cell

Btw, also you'll need import QuartzCore/CALayer.h

like image 111
Mikhail Vasilev Avatar answered Oct 06 '22 01:10

Mikhail Vasilev