注意:
- 必需设置背景色
-
self.layer.masksToBounds
必需为NO
self.backgroundColor = UIColor.whiteColor;
self.layer.masksToBounds = NO;
self.layer.cornerRadius = 8;
self.layer.shadowOpacity = 0.16; //阴影透明度
self.layer.shadowColor = [UIColor blackColor].CGColor; //阴影颜色
self.layer.shadowRadius = 4; //模糊计算的半径
self.layer.shadowOffset = CGSizeMake(0, 0); //阴影偏移量
网友评论