NSAttributedString 上下标---!!!!!

下面这段,亲试可用

/*将符号转换为上标*/

-(NSMutableAttributedString *)changeToSuperscriptForNumberSignWith:(NSString *)string changeString:(NSString *)changeString{

NSRange range = [string rangeOfString:changeString];

NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc]initWithString:string];

NSDictionary * attris = @{NSBaselineOffsetAttributeName:@(3),

NSFontAttributeName:[UIFont systemFontOfSize:9]};

[attributedString setAttributes:attris range:range];

return attributedString;

}

上一篇:oracle踩过的坑


下一篇:mysql数据库转移到oracle的经历