Skip to content

解决yylable在autolayout下自适应时设置对齐方式之后文本intrinsicContentSize计算错误的数值返回导致文本看…#478

Open
LoveSVN wants to merge 1 commit into
ibireme:masterfrom
LoveSVN:master
Open

Conversation

@LoveSVN
Copy link
Copy Markdown

@LoveSVN LoveSVN commented Jun 5, 2018

…不到。 用reveal查看会Lable超级长.

NSMutableAttributedString *arrt= [[NSMutableAttributedString alloc] initWithString:@"asdasdddddddddddddddddd"];
arrt.color = [UIColor redColor];
arrt.alignment = NSTextAlignmentRight;
YYTextLayout *textlayout = [YYTextLayout layoutWithContainerSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) text:arrt];
上面代码在修复前会超级长。在修复后变正常。布局起来就想uilable一样简单

…不到。 用reveal查看会Lable超级长.

NSMutableAttributedString *arrt= [[NSMutableAttributedString  alloc] initWithString:@"asdasdddddddddddddddddd"];
    arrt.color = [UIColor redColor];
    arrt.alignment = NSTextAlignmentRight;
    YYTextLayout *textlayout = [YYTextLayout layoutWithContainerSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) text:arrt];
上面代码在修复前会超级长。在修复后变正常。布局起来就想uilable一样简单
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

Successfully merging this pull request may close these issues.

1 participant