iOS: Text set shadow do not set clipToBounds

This commit is contained in:
pengfei.zhou 2021-09-09 17:48:27 +08:00 committed by osborn
parent 7eba842a55
commit 95ff2155f5

View File

@ -180,6 +180,16 @@ - (void)blendView:(UILabel *)view forPropName:(NSString *)name propValue:(id)pro
}];
}];
} else if ([name isEqualToString:@"shadow"]) {
NSDictionary *dic = prop;
CGFloat opacity = [(NSNumber *) dic[@"opacity"] floatValue];
if (opacity > CGFLOAT_MIN) {
UIColor *color = DoricColor((NSNumber *) dic[@"color"]);
view.layer.shadowColor = color.CGColor;
view.layer.shadowRadius = [(NSNumber *) dic[@"radius"] floatValue];
view.layer.shadowOffset = CGSizeMake([(NSNumber *) dic[@"offsetX"] floatValue], [(NSNumber *) dic[@"offsetY"] floatValue]);
view.layer.shadowOpacity = (float) opacity;
}
} else {
[super blendView:view forPropName:name propValue:prop];
}