iOS 中给文字添加阴影:
NSMutableAttributedString *attributedString=[[NSMutableAttributedString alloc]initWithString:guropName];
NSShadow *shadow = [[NSShadow alloc]init];
shadow.shadowBlurRadius = 1.0;
shadow.shadowOffset = CGSizeMake(1, 1);
shadow.shadowColor = [UIColor blackColor];
[attributedString addAttribute:NSShadowAttributeName
value:shadow
range:NSMakeRange(0, attributedString.length)];
self.labelOne.attributedText=attributedString;
网友评论