iOS 姓名、手机号后加红色的星号*
2019-03-07 本文已影响0人
_蓝星
//html字符串转换为富文本
NSString *htmlStr = @"手机号<span style='color:red'>*</span>";
NSAttributedString *attStr = [[NSAttributedString alloc] initWithData:[htmlStr dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
phoneLabel.attributedText = attStr;