UILabel 字体添加阴影

2019-01-11  本文已影响22人  一个萝卜X个坑
_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;
上一篇 下一篇

猜你喜欢

热点阅读