UILabel设置不同的字体不同的颜色

来源:互联网 发布:北大青鸟网络学费多少 编辑:程序博客网 时间:2024/05/16 10:29

   NSMutableAttributedString *str = [[NSMutableAttributedString allocinitWithString:@"浓情端午\n全城钜惠"];

    [str addAttribute:NSForegroundColorAttributeName value:[UIColorcolorWithHexString:@"#f17815"]range:NSMakeRange(04)];

    [str addAttribute:NSFontAttributeName value:Font_14 range:NSMakeRange(04)];

    up.textLabel.attributedText = str;




0 0
原创粉丝点击