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