mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-11 17:21:11 +08:00
Update offscreen image fix with window checking
Summary:
This commit is contained in:
@@ -177,21 +177,14 @@ RCT_NOT_IMPLEMENTED(-init)
|
||||
}
|
||||
}
|
||||
|
||||
- (void)willMoveToSuperview:(UIView *)newSuperview
|
||||
- (void)didMoveToWindow
|
||||
{
|
||||
[super willMoveToSuperview:newSuperview];
|
||||
[super didMoveToWindow];
|
||||
|
||||
if (!newSuperview) {
|
||||
if (!self.window) {
|
||||
[self.layer removeAnimationForKey:@"contents"];
|
||||
self.image = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didMoveToSuperview
|
||||
{
|
||||
[super didMoveToSuperview];
|
||||
|
||||
if (self.superview && self.src) {
|
||||
} else if (self.src) {
|
||||
[self reloadImage];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user