React Native ListView RefreshControl Offset

724 views Asked by At

I need to change the position of the native Refresh Control.

On Android it is already implemented with progressViewOffset property. I want same behavior on iOS.

I managed this using the following code snippet on RCTScrollView.m

 - (void)setRefreshControl:(RCTRefreshControl *)refreshControl
{
   if (_refreshControl) {
     [_refreshControl removeFromSuperview];
   }
  _refreshControl = refreshControl;
  // I added this line only to change the position
  [[_refreshControl.subviews objectAtIndex:0] setFrame:CGRectMake(0, 50, 20, 30)];

  [self addSubview:_refreshControl];
}

But after I upgrade React Native version to 0.37 I could not achive same effect. I have no idea why it does not work anymore.

0

There are 0 answers