Can't show Image in React Native

后端 未结 13 2619
半阙折子戏
半阙折子戏 2020-12-05 23:31

I\'m using react-native 0.28.0

I\'m trying to show an image on iPhone simulator according to this tutorial: http://www.appcoda.com/react-native-introduction/



        
13条回答
  •  -上瘾入骨i
    2020-12-05 23:44

    After updating IOS 14.x it is an issue being generated that image is not being shown. Here is some info against that.

    It can display the image after adding [super displayLayer:layer]; if _currentFrame is nil

    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, not sure if it is a correct fix.

    node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m

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

提交回复
热议问题