这是我的代码,我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;
字典中指定的其余属性执行正常。
谁能解释为什么?谢谢。