美文网首页
UILabel 字体添加阴影

UILabel 字体添加阴影

作者: 一个萝卜X个坑 | 来源:发表于2019-01-11 15:15 被阅读22次
_numberLbl=[[UILabel alloc]init];

NSShadow *shadow=[[NSShadow alloc]init];
shadow.shadowBlurRadius=6.0;
shadow.shadowOffset=CGSizeMake(0, 0);
shadow.shadowColor=[UIColor blackColor];
NSAttributedString *attString=[[NSAttributedString alloc]initWithString:[NSString stringWithFormat:@"%ld",msgNumber] attributes:@{NSShadowAttributeName:shadow}];
_numberLbl.attributedText=attString;

相关文章

网友评论

      本文标题:UILabel 字体添加阴影

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