设置字体的行距和大小颜色等

http://blog.csdn.net/sinat_19587549/article/details/41683199?utm_source=tuicool&utm_medium=referral这篇博文写的很好,字体的颜色,大小,字体样式,行间距等都涉及到。值得推存的一篇文章。

// 在该方法中设置
- (void)setTextString:(UILabel *)label {
NSString *string = @"字体大小颜色";
//设置字间距
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 3.5; //行距
NSDictionary *attributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:15], NSParagraphStyleAttributeName:paragraphStyle};
label.attributedText = [[NSAttributedString alloc]initWithString: string attributes:attributes];
}





你可能感兴趣的:(iOS)