NSAttributeString使用介紹http://www.reibang.com/p/cfd472e5f78a
NSMutableAttributedString
UILabel * lab = [[UILabel alloc]initWithFrame:CGRectMake(10, 100, 300, 100)];
lab.numberOfLines = 0;
NSString * str = @"冰與火的世界冰與火的世界冰與火的世界冰與火的世界冰與火的世界";
NSMutableDictionary *arrts = [NSMutableDictionary dictionary];
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:str attributes:arrts];
//字體顏色
[attStr setAttributes:@{NSForegroundColorAttributeName : [UIColor orangeColor]} range:NSMakeRange(0, 6)];
//字體顏色大小
[attStr setAttributes:@{NSForegroundColorAttributeName : [UIColor redColor],NSFontAttributeName : [UIFont systemFontOfSize:30]} range : NSMakeRange(24, 6)];
//行距
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 16;
NSRange range = NSMakeRange(0, attStr.length);
[attStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:range];
lab.attributedText = attStr;
[self.view addSubview:lab];