iOS 添加阴影

 1 /**
 2  *  创建 label 阴影
 3  */
 4 - (void)_createLabelShadow:(UILabel *)label
 5 {
 6     label.layer.shadowColor = [UIColor blackColor].CGColor;
 7     label.layer.shadowOffset = CGSizeMake(1,1);//shadowOffset阴影偏移,x向右偏移4,y向下偏移4,默认(0, -3),这个跟shadowRadius配合使用 
 8     label.layer.shadowOpacity = 0.8;//阴影透明度,默认0
 9     label.layer.shadowRadius = 1;//阴影半径,默认3 
10 }
原文地址:https://www.cnblogs.com/lz465350/p/7744190.html