Open lijialiang opened 5 years ago
这么写试试
_textView = [[YYTextView alloc] initWithFrame:self.view.frame];
_textView.placeholderText = @"位置有偏差";
_textView.placeholderFont = [UIFont systemFontOfSize:18];
NSMutableAttributedString *mAtt = [[NSMutableAttributedString alloc] initWithString:@""];
[mAtt addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18] range:NSMakeRange(0, mAtt.length)];
mAtt.yy_lineSpacing = 6.0f;
mAtt.yy_kern = @(0.5);
_textView.selectedRange = NSMakeRange(mAtt.length, 0);
_textView.attributedText = mAtt;
_textView.font = [UIFont systemFontOfSize:18];
_textView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
大概通过如下代码设置行高以及 placeholder
请问该如何设置行高,让 placeholderText 位置与 输入文字 位置一致?