change px to proportion

This commit is contained in:
王劲鹏
2020-04-17 15:18:01 +08:00
committed by osborn
parent 36eaf35cd0
commit 4c18171a2b
3 changed files with 19 additions and 11 deletions

View File

@@ -240,7 +240,7 @@ - (void)afterBlended:(NSDictionary *)props {
CGFloat top = [self.stretchInsetDic[@"top"] floatValue];
CGFloat right = [self.stretchInsetDic[@"right"] floatValue];
CGFloat bottom = [self.stretchInsetDic[@"bottom"] floatValue];
UIImage *result = [self.view.image resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right) resizingMode:UIImageResizingModeStretch];
UIImage *result = [self.view.image resizableImageWithCapInsets:UIEdgeInsetsMake(top * self.view.image.size.height, left * self.view.image.size.width, bottom * self.view.image.size.height, right * self.view.image.size.width) resizingMode:UIImageResizingModeStretch];
self.view.image = result;
}
}