ios UI笔记

2017-09-06  本文已影响0人  Kira丶陈

1.UILabel加阴影效果
答案:http://www.jianshu.com/p/e8afb0e23158
因为label数据随时更新,所以换用NSMutableAttributedString:

  NSShadow *shadow = [NSShadow new];
  shadow.shadowColor = [MHColorUtils colorWithRGB:0x000000 alpha:0.28];
  shadow.shadowBlurRadius = HLQF3scalePT(1);
  shadow.shadowOffset = CGSizeMake(HLQF3scalePT(0.5), HLQF3scalePT(0.5));
  UIFont *font = [UIFont fontWithName:@"PingFangSC-Medium" size:12];
 NSMutableAttributedString  tempString = [[NSMutableAttributedString alloc] initWithString:@"test" attributes:@{NSShadowAttributeName:shadow,NSFontAttributeName:font,NSForegroundColorAttributeName:[UIColor blackColor]}];
上一篇 下一篇

猜你喜欢

热点阅读