目标C:如何将阴影效果添加到导航栏和表单元格
可能重复:
如何使用Quartz 2D将投影添加到UIImage或UIImageView?
嗨,
我已经创build了一个tableViewController,并试图为导航栏以及表单元格添加阴影效果。 任何人都可以指导我这样做?
谢谢!
甄锄
尝试这个
yourView.layer.shadowColor = [[UIColor blackColor] CGColor]; yourView.layer.shadowOffset = CGSizeMake(1.0f, 1.0f); yourView.layer.shadowRadius = 3.0f; yourView.layer.shadowOpacity = 1.0f;
您需要用导航栏或表格单元replace“yourView”
顺便说一句,你也需要导入QuartzCore / CALayer.h