#pragma mark - 给UILabel增加上下标
-(NSMutableAttributedString *)changeToSuperscriptForNumberSignWith:(NSString *)string changeString:(NSString *)changeString{
NSRange range = [string rangeOfString:changeString];
NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc]initWithString:string];
NSDictionary * attris = @{NSBaselineOffsetAttributeName:@(11),
NSFontAttributeName:[UIFont systemFontOfSize:10]};
[attributedString setAttributes:attris range:range];
return attributedString;
}
网友评论