React Native 在高IOS版本下无法显示图片的问题处理

图片在低ios版本下可以看到图片,在高版本ios下显示不了图片

直接上解决方法

找文件 /node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m 修改源码

原代码

复制代码
if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
}

修改后代码

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

实测有效,才来分享

相关推荐
传奇开心果编程15 小时前
【Flutter踩坑排雷】第19课:路由硬编码坑|字符串路由书写错误,页面跳转失败排查
android·flutter·ios·移动开发·跨平台·ui框架·声明式ui
茶底世界之下18 小时前
雨后街口的斑马线:用 Awaking 把颜色让给光与步伐
ios·app·产品
茶底世界之下2 天前
晨雾河岸的旧书摊:用 Awaking 给木色一点暖光
ios·app·产品
90后的晨仔2 天前
在 macOS 27 上运行 Xcode 26
ios
用户298698530143 天前
React 前端将 Excel 工作表导出为图片的技术实践
javascript·react.js·excel
茶底世界之下3 天前
山间站台不必转暖:用 Awaking 留住冷光与红箱
ios·app·产品
songgeb3 天前
YYImage Bug:一行之差,正常 JPEG 如何在 iOS 被读成条纹
ios·swift
終不似少年遊*4 天前
【安全业务Agent】从场景到编排
python·react.js·ai·langchain·agent·安全架构·工作流
茶底世界之下4 天前
阴天花摊不必变暖:用 Awaking 留住花色与湿街
ios·app·产品