首页 > 移动平台 > 详细

iOS 文本首行缩进

时间:2015-03-23 17:40:55      阅读:344      评论:0      收藏:0      [点我收藏+]
 1 NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
 2     paragraphStyle.lineHeightMultiple = 20.f;
 3     paragraphStyle.maximumLineHeight = 25.f;
 4     paragraphStyle.minimumLineHeight = 15.f;
 5     paragraphStyle.firstLineHeadIndent = 20.f; // 首行缩进
 6     paragraphStyle.alignment = NSTextAlignmentJustified;
 7     NSMutableDictionary *attributes = [@{ NSFontAttributeName:[UIFont systemFontOfSize:15], NSParagraphStyleAttributeName:paragraphStyle, NSForegroundColorAttributeName:[UIColor colorWithRed:153/255. green:102/255. blue:51/255. alpha:1]
 8                                           }mutableCopy];
 9     self.textView.attributedText = [[NSAttributedString alloc]initWithString:@"ssssssssssssssssssssssss" attributes:attributes];
10 }

 

iOS 文本首行缩进

原文:http://www.cnblogs.com/jinyaowei/p/4360333.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!