React Native 在IOS 14.0下调试无法显示图片的问题处理


一、现象

应用在IOS 14.0下调试无法显示图片

 

二、解决

1、在依赖包中找到文件:RCTUIImageViewAnimated.m 

 路径如:/node_modules/react-native/Libraries/Image 下

 

2、修改文件,大概269行

原:

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

}

 

 

三、总结

 

参考文档:React Native 中文网的讨论问题: https://github.com/reactnativecn/react-native-website/issues/299

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM