Xcode升級(jí)12后,ReactNative ios14看不見(jiàn)圖片(靜態(tài)圖片和網(wǎng)絡(luò)圖片)
解決方法
1、第一種:修改node_modules中react-native/Libraries/Image/RCTUIImageViewAnimates.m文件
if(_currentFrame){ //275行
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
}else{ //加上這個(gè) 不然ios14以上的系統(tǒng)看不見(jiàn)圖片
[super displayLayer:layer];
}
2、第二種:升級(jí)reactNative版本,大于或者等于0.63版本
此方法不建議采用,可能會(huì)影響項(xiàng)目中其他第三方庫(kù)
轉(zhuǎn)載自 https://blog.csdn.net/TanHao8/article/details/108789511