YYText
YYText copied to clipboard
YYTextView's font will change after adding a attachment
I had set the font of YYTextView to 17
. But if I add an attachment to this textview, the font of YYTextView would change. And I can't do anything to avoid it.
I do like this,it works well
_textView = [[YYTextView alloc] initWithFrame:self.view.frame];
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;
I do like this,it works well
_textView = [[YYTextView alloc] initWithFrame:self.view.frame]; 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;
I don't think it's good enough. If I want some feature in specific range which do not want cover by other setting, I cound not use this way.
I had set the font of YYTextView to
17
. But if I add an attachment to this textview, the font of YYTextView would change. And I can't do anything to avoid it.
Hi, have you already solve this problem?
@sandychales If you want to solve this problem, you should change the source code of YYText by removing the continuous feature. I didn't find any other ways to solve it.
@starFelix how to remove it?
@starFelix do you know how to remove the continuous feature?