Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParagraphStyle相关属性的配置可能影响全局(ParagraphStyleSet的Bug) #379

Open
Archerlly opened this issue Jun 16, 2016 · 0 comments

Comments

@Archerlly
Copy link

Archerlly commented Jun 16, 2016

单独设置attributedText, 由于attributedText.yy_lineSpacing与atr1.yy_lineSpacing的值一样, 导致lab1的富文本配置都变成了attributedText的配置, 而lab2没受影响.

YYLabel *lab1 = [YYLabel new];
YYLabel *lab2 = [YYLabel new];
NSMutableAttributedString *atr1 = [[NSMutableAttributedString alloc] initWithString:@"精神科拉附近的开始垃圾\n来的看撒娇范德萨"];
NSMutableAttributedString *atr2 = [[NSMutableAttributedString alloc] initWithString:@"精神科拉附近的开始垃圾\n来的看撒娇范德萨"];

atr1.yy_lineSpacing = 3;
atr2.yy_lineSpacing = 4;

lab1.numberOfLines = 0;
lab2.numberOfLines = 0;
lab1.attributedText = atr1;
lab2.attributedText = atr2;
lab1.frame = CGRectMake(50, 50, 100, 200);
lab2.frame = CGRectMake(160,50, 100, 200);
[self.view addSubview:lab1];
[self.view addSubview:lab2];

NSMutableAttributedString *attributedText = [NSMutableAttributedString new];
[attributedText yy_appendString:@" "];

attributedText.yy_lineSpacing = 3;
attributedText.yy_headIndent = 2;
attributedText.yy_paragraphSpacing = 20;
attributedText.yy_firstLineHeadIndent = 30;

review代码发现 enumerateAttribute: inRange: options: usingBlock: 这个API遍历的时候拿错了, 期待你的修复, 谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant