IOS 14图像未在本机反应中显示

时间:2021-07-05 13:48:42

标签: ios image react-native react-native-ios ios14

<块引用>

我无法在 IOS 14 Simulator 和 Iphone 上渲染图像

使用来自 react-native 和 react-native-fast-image 的 Image

1 个答案:

答案 0 :(得分:1)

添加[super displayLayer:layer]后可以显示图片;如果_currentFrame 为nil 如果我理解正确的话,_currentFrame 应该是用于动画图像的,所以如果它是静止图像,我们可以使用UIImage 实现来处理图像渲染,不确定它是否正确修复。

<块引用>

react-native/Libraries/Image/RCTUIImageViewAnimated.m

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