以为两个label就能轻松搞定的,真的动手做的时候发现label是要换行,换行的。。
下面给大家介绍一个富文本超好用的方法,那就是首行缩进
NSMutableParagraphStyle * graphStyle = [[NSMutableParagraphStyle alloc]init];
graphStyle.firstLineHeadIndent = self.iconLab.frame.size.width + 5;
NSMutableAttributedString * titleStr = [[NSMutableAttributedString alloc]initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSParagraphStyleAttributeName: graphStyle}];
self.titleLab.attributedText = titleStr;