下面以给cell加阴影为例介绍加阴影的方法
self.contentView.backgroundColor = [UIColor whiteColor];
self.contentView.layer.shadowColor = [UIColor blackColor].CGColor;
//阴影的角度,分别是靠右和靠下。
self.contentView.layer.shadowOffset = CGSizeMake(0, 10);
self.contentView.layer.shadowRadius = 1.0;
self.contentView.layer.shadowOpacity = 0.8;
UIBezierPath * path = [UIBezierPath bezierPathWithRoundedRect:self.contentView.bounds cornerRadius:1.0];
self.contentView.layer.shadowPath = path.CGPath;
具体的参数,可以自己尝试调整,实现很简单,调整起来,也是非常的简单。