mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Update offscreen image fix with window checking
Summary:
This commit is contained in:
1 parent
eab7b00cee
commit
bb883bfb61
1 file changed
+4
-11
@@ -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