From dcdf16a0fbe8ded9af6ed75ad0c3ec627e56b75a Mon Sep 17 00:00:00 2001 From: Gant Date: Sun, 4 Sep 2016 01:39:25 -0700 Subject: [PATCH] RefreshControl Position Bug Summary: Refresh bug #7976 This bug has persisted for 3 versions of React Native. Currently everyone is having to do a silly fix, documented in the bug. I spent an hour trying to find the source of the bug. Failing to find the issue quickly, I've just decided to make this simple bugfix. According to janicduplessis #7976 we will likely be re-writing this control in iOS 10. Closes https://github.com/facebook/react-native/pull/9249 Differential Revision: D3817227 fbshipit-source-id: f98282aadeca3e85239836f589eda901d454f2ce --- React/Views/RCTRefreshControl.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/React/Views/RCTRefreshControl.m b/React/Views/RCTRefreshControl.m index 1b11bdcfe..814c5fa5a 100644 --- a/React/Views/RCTRefreshControl.m +++ b/React/Views/RCTRefreshControl.m @@ -33,6 +33,12 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder) { [super layoutSubviews]; + // Fix for bug #7976 + // TODO: Remove when updating to use iOS 10 refreshControl UIScrollView prop. + 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 && _initialRefreshingState) {