0

Getting an issue local images not loading just showing blank in Ios

<Image source={ImagePath.headerBgImage} style={{ width: "100%" }} />;
MarioG8
  • 5,122
  • 4
  • 13
  • 29
deepanshu katyal
  • 631
  • 1
  • 8
  • 18

2 Answers2

0

if I understand correctly, _currentFrame should be for animated image, so if it is still image, we can use the UIImage implementation to handle image rendering

react-native/Libraries/Image/RCTUIImageViewAnimated.m OR in pods React- RCTImage>RCTUIImageViewAnimated.m

Lines 283 to 289 in 1c634a9

 - (void)displayLayer:(CALayer *)layer 
 { 
   if (_currentFrame) { 
     layer.contentsScale = self.animatedImageScale; 
     layer.contents = (__bridge id)_currentFrame.CGImage; 
   } 
 } 

Replace above code with

if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }
deepanshu katyal
  • 631
  • 1
  • 8
  • 18
0

you should go to this file :

node_modules > react-native > Libraries > Images > RCTUIImageViewAnimated.m

and search word if (_currentFrame) then after find that add else like this :

 if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

for more info see this link

Meisan Saba
  • 800
  • 2
  • 9
  • 25