开发者

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

开发者 https://www.devze.com 2023-03-06 15:26 出处:网络
This question already has answers here: 开发者_如何学JAVA Closed 11 years ago. Possible Duplicate:
This question already has answers here: 开发者_如何学JAVA Closed 11 years ago.

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


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

0

精彩评论

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