Open CarmineRumma opened 6 months ago
@CarmineRumma I tried to apply this patch and it will not work for me it give me a error Use of undeclared identifier 'image'
@husenLogicwind I've used following patch my build created but I'm not sure weather its accurate or not @CarmineRumma please verify this.
diff --git a/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.m b/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.m
index 02a5f49..4ffa62f 100644
--- a/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.m
+++ b/node_modules/react-native-vector-icons/RNVectorIconsManager/RNVectorIconsManager.m
@@ -63,13 +63,13 @@ - (BOOL)createAndSaveGlyphImage:(NSString *)glyph withFont:(UIFont *)font
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:glyph attributes:@{NSFontAttributeName: font, NSForegroundColorAttributeName: color}];
CGSize iconSize = [attributedString size];
- UIGraphicsBeginImageContextWithOptions(iconSize, NO, 0.0);
- [attributedString drawAtPoint:CGPointMake(0, 0)];
-
- UIImage *iconImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
-
- NSData *imageData = UIImagePNGRepresentation(iconImage);
+ UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+ UIImage* newImage = [image imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate];
+ UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:iconSize];
+ newImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
+ [attributedString drawAtPoint:CGPointMake(0, 0)];
+ }];
+ NSData *imageData = UIImagePNGRepresentation(newImage);
return [imageData writeToFile:filePath atomically:YES];
}
UIGraphicsBeginImageContextWithOptions Patch