-
Notifications
You must be signed in to change notification settings - Fork 1.7k
YYTextBorder insets属性中的top、bottom 值小于0时,边框绘制不出来~ #341
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
Comments
border.insets = UIEdgeInsetsMake(0, -10, 0, -10); 没有问题~,总感觉这种bug比较微妙~,好像跟字体大小也有关系~ |
调整 label 的高度,保证 UILabel (UIView) 大小能容纳下 border 的内容。 |
YYLabel 的位置大小是 self.view.bounds |
所以高度一定够 |
|
定位到问题了,稍后修复。 |
@ibireme 牛,是1.0.6 发么? |
Fixed。之后更新版本时,会推送到 CocoaPods。 |
CocoaPods导入YYKit 1.0.5版本 还会出现此问题 |
@EvanZhou0319 更新版本啊。 |
YYTextBorder insets属性中的top、bottom 值小于0时,边框绘制不出来~
代码:
NSMutableAttributedString *text = [[NSMutableAttributedString alloc] init];
{
NSMutableAttributedString *one = [[NSMutableAttributedString alloc] initWithString:@"文本二"];
one.yy_font = [UIFont boldSystemFontOfSize:10];
one.yy_color = [UIColor redColor];
YYTextBorder *border = [YYTextBorder new];
border.cornerRadius = 50;
border.insets = UIEdgeInsetsMake(-4, -10, -4, -10);
border.strokeWidth = 0.5;
border.strokeColor = one.yy_color;
border.lineStyle = YYTextLineStyleSingle;
one.yy_textBackgroundBorder = border;
[text appendAttributedString:one];
[text appendAttributedString:[self padding]];
}
_refLab.attributedText = text;
The text was updated successfully, but these errors were encountered: