NSMutableAttributedString 设置字体大小不同时 让小字体居上

NSMutableAttributedString *dollarAttString = [[NSMutableAttributedString alloc] initWithString:@"374386.346 BTC" attributes:@{NSKernAttributeName:@(2.0f)}];
    [dollarAttString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"DINAlternate-Bold" size:34] range:NSMakeRange(0,10)];
    [dollarAttString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"DINAlternate-Bold" size:20] range:NSMakeRange(11,3)];
    [dollarAttString addAttribute:NSBaselineOffsetAttributeName value:@(10) range:NSMakeRange(11, 3)];

你可能感兴趣的:(NSMutableAttributedString 设置字体大小不同时 让小字体居上)