使用NSShadow来设置阴影属性
NSShadow *shadow = [[NSShadow alloc] init];
shadow.shadowBlurRadius = 2;//阴影半径,默认值3
shadow.shadowColor = [UIColor blackColor];//阴影颜色
shadow.shadowOffset = CGSizeMake(0,2);//阴影偏移量,x向右偏移,y向下偏移,默认是(0,-3)
NSAttributedString * attributedText = [[NSAttributedString alloc] initWithString:@"test" attributes:@{NSShadowAttributeName:shadow}];
最后将富文本attributedText赋值给label就ok了