美文网首页
ios UI笔记

ios UI笔记

作者: Kira丶陈 | 来源:发表于2017-09-06 18:37 被阅读0次

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]}];

相关文章

网友评论

      本文标题:ios UI笔记

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