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

实测有效,才来分享

相关推荐
YFF菲菲兔2 小时前
其他 Hooks 解析
react.js
wabil10 小时前
【LVGL】滑动切换页面的界面优化实践
开发语言·ios·swift
威武的花瓣10 小时前
调用Page.RegisterAsyncTask()的异步页
ios·iphone
想你依然心痛10 小时前
AtomCode 在前端开发中的实战体验:React + TypeScript 项目开发实录
前端·react.js·typescript
前端炒粉10 小时前
个人简历面经总结二
前端·网络·vue.js·react.js·面试
Digitally1 天前
5 种简易方法:摩托罗拉手机数据迁移至 iPhone 17
ios·智能手机·iphone
谢尔登1 天前
【React】 状态管理方案
前端·react.js·前端框架
Eiceblue1 天前
使用 JavaScript 在 React 中实现 Word 转 PDF
javascript·react.js·word
光影少年2 天前
react navite 跨端核心原理
前端·react native·react.js
用户298698530142 天前
在 React 中使用 JavaScript 合并 Excel 文件
前端·javascript·react.js