【问题标题】:IOS 14 Images rendering Issue react nativeIOS 14图像渲染问题本机反应
【发布时间】:2023-03-14 19:15:01
【问题描述】:

我无法在 IOS 14 模拟器上渲染图像

我已经尝试了以下

issue resolution

但是在尝试了上面的代码之后,当我重新构建代码时,更改会自动撤消,问题仍然存在。

【问题讨论】:

    标签: ios react-native ios14


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2021-09-26
      • 2019-02-16
      • 2021-09-16
      • 1970-01-01
      • 1970-01-01
      • 2014-10-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多