美文网首页
给UILabel增加上下标

给UILabel增加上下标

作者: 沬日十七 | 来源:发表于2017-02-23 10:21 被阅读0次

    #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;

    }

    相关文章

      网友评论

          本文标题:给UILabel增加上下标

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