iOS:when set corner,apply clipToBounds to yes

This commit is contained in:
pengfei.zhou 2020-02-21 20:53:02 +08:00 committed by osborn
parent 3e3e8266d4
commit ef2e27f271

View File

@ -198,6 +198,7 @@ - (void)blendView:(UIView *)view forPropName:(NSString *)name propValue:(id)prop
view.layer.borderWidth = width; view.layer.borderWidth = width;
view.layer.borderColor = color.CGColor; view.layer.borderColor = color.CGColor;
} else if ([name isEqualToString:@"corners"]) { } else if ([name isEqualToString:@"corners"]) {
self.view.clipsToBounds = YES;
if ([prop isKindOfClass:NSNumber.class]) { if ([prop isKindOfClass:NSNumber.class]) {
view.layer.cornerRadius = [(NSNumber *) prop floatValue]; view.layer.cornerRadius = [(NSNumber *) prop floatValue];
} else if ([prop isKindOfClass:NSDictionary.class]) { } else if ([prop isKindOfClass:NSDictionary.class]) {