[Fixed]Images are not showing in iOS 14

Original Post: https://theblueplug.com/images-not-showing-in-ios-react-native/



 1. run "npm i -g patch-package"

 2. Create a folder named "patches" in your root of the project


3. Get the react-native version from the package.json file (it should be under dependencies section)

For Example : "react-native": "0.61.5",


4. Create file named 

react-native+<version_code>.patch

Example : react-native+0.61.5.patch


5. Add the below code into that file


diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m index 21f1a06..2444713 100644 --- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m +++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m @@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink - (void)displayLayer:(CALayer *)layer { + if (!_currentFrame) { + _currentFrame = self.image; + } if (_currentFrame) { layer.contentsScale = self.animatedImageScale; layer.contents = (__bridge id)_currentFrame.CGImage; diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env new file mode 100644 index 0000000..361f5fb --- /dev/null +++ b/node_modules/react-native/scripts/.packager.env @@ -0,0 +1 @@ +export RCT_METRO_PORT=8081


6. run "patch-package" on the root of the project



Custom Mobile App Development: https://kenitechnologies.com












Comments

Popular posts from this blog

[Free] How To Install WordPress with Nginx in Ubuntu 20.04 Oracle Cloud?

Is Time Travel Possible ?

[Fixed]My network requests are not working in Android Pie!