YYText icon indicating copy to clipboard operation
YYText copied to clipboard

YYTextView's font will change after adding a attachment

Open starFelix opened this issue 6 years ago • 6 comments

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. image

starFelix avatar Feb 19 '19 10:02 starFelix

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;

liuliangju avatar Feb 22 '19 08:02 liuliangju

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.

starFelix avatar Mar 11 '19 06:03 starFelix

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. image

Hi, have you already solve this problem?

sandychales avatar Jun 28 '19 01:06 sandychales

@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 avatar Jun 30 '19 13:06 starFelix

@starFelix how to remove it?

SolorzanoJose avatar Jul 23 '20 01:07 SolorzanoJose

@starFelix do you know how to remove the continuous feature?

SolorzanoJose avatar Jul 24 '20 00:07 SolorzanoJose