Вот мой код, я поставил один ASTextNode
в моем суперпредставлении и применил некоторые атрибуты, но некоторые из них не работают, такие как ASTextBorder
.
CGFloat top = 10;
CGFloat bottom = -1;
UIEdgeInsets insets = UIEdgeInsetsMake(top, -10, bottom, -10);
CGFloat radius = font.pointSize / 2;
mps.alignment = textAlignment; //NSMutableParagraphStyle
ASTextNode *textNode = [ASTextNode new];
ASTextBorder *asBorder = [ASTextBorder borderWithFillColor:UIColor.redColor cornerRadius:radius];
asBorder.insets = insets;
NSDictionary *attributes = @{
NSForegroundColorAttributeName: UIColor.whiteColor,
NSFontAttributeName: font,
NSStrokeWidthAttributeName: @(-5),
NSStrokeColorAttributeName: UIColor.blackColor,
NSParagraphStyleAttributeName: mps,
ASTextBorderAttributeName: asBorder,
};
textNode.attributedText = [[NSAttributedString alloc] initWithString:text attributes:attributes];
textNode.textContainerInset = UIEdgeInsetsMake(0, 10, 5, 10);
return textNode;
Остальные атрибуты, указанные в словаре, работают нормально.
Кто-нибудь может объяснить, почему? Спасибо.