Nathan Walker
2023-10-09 12:00:21 -07:00
committed by GitHub
parent 93e24783a1
commit d6478237ec
18 changed files with 230 additions and 76 deletions

View File

@@ -10,4 +10,6 @@
-(void)nativeScriptSetFormattedTextDecorationAndTransform:(NSDictionary*)details letterSpacing:(CGFloat)letterSpacing lineHeight:(CGFloat)lineHeight;
-(void)nativeScriptSetFormattedTextStroke:(CGFloat)width color:(UIColor*)color;
@end

View File

@@ -130,4 +130,19 @@
((UILabel*)self).attributedText = attrText;
}
}
-(void)nativeScriptSetFormattedTextStroke:(CGFloat)width color:(UIColor*)color {
if (width > 0) {
NSMutableAttributedString *attrText = [[NSMutableAttributedString alloc] initWithAttributedString:((UILabel*)self).attributedText];
[attrText addAttribute:NSStrokeWidthAttributeName value:[NSNumber numberWithFloat:width] range:(NSRange){
0,
attrText.length
}];
[attrText addAttribute:NSStrokeColorAttributeName value:color range:(NSRange){
0,
attrText.length
}];
((UILabel*)self).attributedText = attrText;
}
}
@end