iOS UIView添加阴影

_bottomView.layer.masksToBounds = NO;
_bottomView.backgroundColor = [UIColor whiteColor];
_bottomView.layer.shadowColor = [UIColor blackColor].CGColor;   
_bottomView.layer.shadowOffset = CGSizeMake(0,4);   //0,0围绕阴影四周  0,4向下有4个像素的偏移
_bottomView.layer.shadowOpacity = 0.15;   //设置阴影透明度
_bottomView.layer.shadowRadius = 5;      //设置阴影圆角
_bottomView.layer.cornerRadius = 8;     //设置视图圆角 
posted @ 2018-03-26 14:56  qqcc1388  阅读(820)  评论(0编辑  收藏  举报