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

使用特殊文本时,YYLabel会有一长串的空格 #915

Open
mythkiven opened this issue Dec 30, 2019 · 1 comment
Open

使用特殊文本时,YYLabel会有一长串的空格 #915

mythkiven opened this issue Dec 30, 2019 · 1 comment

Comments

@mythkiven
Copy link

代码与效果,见图片:

使用特殊文本时,YYLabel会有一长串的空格

@mythkiven
Copy link
Author

code:

NSMutableAttributedString *attString = [NSMutableAttributedString new];
    UIFont *font = [UIFont systemFontOfSize:16];
    NSString *string = @"ޙޓゝ₯";
    [attString appendAttributedString:[[NSAttributedString alloc] initWithString:string attributes:nil]];
    attString.yy_font = font;
    YYLabel * yylabel = [YYLabel new];
    yylabel.textVerticalAlignment = YYTextVerticalAlignmentTop;
    yylabel.textAlignment = NSTextAlignmentLeft;
    yylabel.backgroundColor = [UIColor cyanColor];
    yylabel.frame = CGRectMake(100, 200, 210, 30);
    yylabel.attributedText = attString;
    [self.view addSubview:yylabel];

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