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

如果高度限制, 会只显示半行 #140

Open
okerivy opened this issue Jul 9, 2019 · 0 comments
Open

如果高度限制, 会只显示半行 #140

okerivy opened this issue Jul 9, 2019 · 0 comments

Comments

@okerivy
Copy link

okerivy commented Jul 9, 2019

如果高度限制, 会有半行的情况出现
代码如下, 可以直接粘贴运行


    TYAttributedLabel *label2 = [[TYAttributedLabel alloc]init];
    label2.backgroundColor = [UIColor lightGrayColor];
    label2.frame = CGRectMake(0, 100+10, CGRectGetWidth(self.view.frame), 60);
    [self.view addSubview:label2];
    
    // 追加(添加到最后)文本
    [label2 appendText:@"\t任何值得去的地方任何值得去的地方任何值得去的地方任何值得去的地方任何值得去的地方"];
    [label2 appendImageWithName:@"haha" size:CGSizeMake(15, 15)];
    [label2 appendText:@",都没“有捷径“"];
    [label2 appendImageWithName:@"haha" size:CGSizeMake(15, 15)];
    [label2 appendText:@"\t任何值得等待的人,都会迟来一些;所以,不要怕,不要担心\n"];
    [label2 appendText:@"\t任何值得追逐的梦想,都必须在一路艰辛中备受嘲笑。\n"];
    [label2 appendText:@"\t所以,不要怕,不要担心你所追逐的有可能是错的。\n"];
    [label2 appendText:@"\t因为,不被嘲笑的梦想不是梦想。\n"];

如图所示

aaa@2x

请问怎么能显示正确, 不显示半行

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