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];
}

实测有效,才来分享

相关推荐
程序员老刘1 小时前
Flutter你看看人家RN
flutter·react native·ai编程
Coder_张三4 小时前
iOS 26 适配
前端·ios·swift
用户38034165882975 小时前
崩溃率从 0.3% 到 0.04%:我们做对的不是修 bug,是让每个崩溃只发生一次
ios·swift
Java后端的Ai之路8 小时前
07React_Props验证器
人工智能·python·react.js·架构·fastapi
2501_915921438 小时前
详细教程:使用Perfdog工具测量iOS应用的功耗性能与优化方法
android·macos·ios·小程序·uni-app·cocoa·iphone
风雨_9 小时前
RTK (Rust Token Killer) 安装、使用与卸载指南
ios
Aolith9 小时前
从收藏到错题本,我在 React 全栈项目里实现了一套复习系统
mongodb·react.js·全栈
是你的小橘呀9 小时前
告别各写各的!从 0 到 1 打造 React Native 客户端公共动效基础设施 🏗️
react native
茶底世界之下9 小时前
夜景暗部要提亮多少?用 Awaking 给雪夜街道留一点层次
ios