文本框缩进
作者:
赤焰军少帅林殊 | 来源:发表于
2017-12-08 16:45 被阅读27次 -(void)textViewDidChange:(UITextView *)textView{
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 5; //行间距
paragraphStyle.firstLineHeadIndent = 5*kRating; /**首行缩进宽度*/
paragraphStyle.alignment = NSTextAlignmentLeft;
NSDictionary *attributes = @{
NSFontAttributeName:[UIFont systemFontOfSize:14*kRating],
NSParagraphStyleAttributeName:paragraphStyle
};
textView.attributedText = [[NSAttributedString alloc] initWithString:textView.text attributes:attributes];
}
//注意方法名
本文标题:文本框缩进
本文链接:https://www.haomeiwen.com/subject/flaeixtx.html
网友评论