更新到Xcode12 之后运行项目、然后图片不显示
解决方案:
Xcode快捷键 command+shift+O 搜索 RCTUIImageViewAnimated
在RCTUIImageViewAnimated.m 找到 267行
修改如下方法即可
- (void)displayLayer:(CALayer *)layer
{
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
}
}
修改为:
- (void)displayLayer:(CALayer *)layer
{
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
} else {
[super displayLayer:layer];
}
}
注:该bug在rn0.63已解决