From ccdb305fc1c8567a590af30f2335ddd4811e5335 Mon Sep 17 00:00:00 2001 From: Stefan Wrobel Date: Wed, 10 Feb 2021 18:16:10 -0500 Subject: [PATCH] Restore refresh spinner fix Fixes #30912 Reverts #31024 which was not shown to fix the issue --- React/Views/RefreshControl/RCTRefreshControl.m | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/React/Views/RefreshControl/RCTRefreshControl.m b/React/Views/RefreshControl/RCTRefreshControl.m index 6985c38bce40b2..c9af466837e064 100644 --- a/React/Views/RefreshControl/RCTRefreshControl.m +++ b/React/Views/RefreshControl/RCTRefreshControl.m @@ -41,6 +41,11 @@ - (void)layoutSubviews { [super layoutSubviews]; + // Fix for bug #7976 + if (self.backgroundColor == nil) { + self.backgroundColor = [UIColor clearColor]; + } + // If the control is refreshing when mounted we need to call // beginRefreshing in layoutSubview or it doesn't work. if (_currentRefreshingState && _isInitialRender) { @@ -49,18 +54,6 @@ - (void)layoutSubviews _isInitialRender = false; } -- (void)didMoveToWindow -{ - [super didMoveToWindow]; - - // Since iOS 14 there seems to be a bug where refresh control becomes - // visible if the view gets removed from window then added back again. - // Calling endRefreshing fixes the layout. - if (!_currentRefreshingState) { - [super endRefreshing]; - } -} - - (void)beginRefreshingProgrammatically { UInt64 beginRefreshingTimestamp = _currentRefreshingStateTimestamp;