- 在依赖包中找到文件:
RCTUIImageViewAnimated.m
路径:/node_modules/react-native/Libraries/Image
2.将RCTUIImageViewAnimated.m
中的下面代码添加[super displayLayer:layer];
- (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];
}
}
网友评论