美文网首页iOS
iOS中给文字添加阴影

iOS中给文字添加阴影

作者: 单酱色 | 来源:发表于2017-01-14 16:22 被阅读125次

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;

相关文章

网友评论

    本文标题:iOS中给文字添加阴影

    本文链接:https://www.haomeiwen.com/subject/lwiebttx.html