Open GrapeFruitJun opened 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;`
这种需求应该使用TextBackgroundBorder属性
使用TextBackgroundBorder也是有问题
YYKit 版本 1.0.9 `NSArray * chars = @[@"测",@"试",@"测",@"试",@"测",@"试",@"测",@"试",@"测",@"试"];