ibireme / YYText

Powerful text framework for iOS to display and edit rich text.
MIT License
8.84k stars 1.69k forks source link

YYTextBorder 填充颜色文字显示不出来,文字被覆盖 #885

Open GrapeFruitJun opened 5 years ago

GrapeFruitJun commented 5 years ago

YYKit 版本 1.0.9 `NSArray * chars = @[@"测",@"试",@"测",@"试",@"测",@"试",@"测",@"试",@"测",@"试"];

for (int i = 0; i < chars.count; i++) {
    NSString * tempString = chars[i];
    NSLog(@"%@",tempString);
    NSMutableAttributedString * tempAttribute = [[NSMutableAttributedString alloc] initWithString:tempString];
    tempAttribute.font = UIFontMake(20);
    tempAttribute.color = UIColorMakeWithHex(@"#B4B4B4");
    UIColor * fillColor = i % 2 == 1 ? UIColorRed : UIColorBlue;
    YYTextBorder *border = [YYTextBorder borderWithFillColor:fillColor cornerRadius:10];
    border.insets = UIEdgeInsetsMake(-2, -2, -2, -2);
    tempAttribute.textBorder = border;
    [interval appendAttributedString:tempAttribute];   
}

interval.lineSpacing = 5;
interval.lineBreakMode = NSLineBreakByWordWrapping;`

1557995900184

ZhongshanHuang commented 5 years ago

这种需求应该使用TextBackgroundBorder属性

songgeb commented 9 months ago

这种需求应该使用TextBackgroundBorder属性

使用TextBackgroundBorder也是有问题