文本框缩进

-(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]; } //注意方法名

    推荐阅读