Automatically adjust content inset after view controller did layout subviews

This commit is contained in:
Alexey Lang
2015-09-04 05:50:01 -07:00
parent bb5522582d
commit bbeaac5d3b
8 changed files with 53 additions and 9 deletions

View File

@@ -460,10 +460,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
_scrollView.frame = self.bounds;
_scrollView.contentOffset = originalOffset;
[RCTView autoAdjustInsetsForView:self
withScrollView:_scrollView
updateOffset:YES];
[self updateClippedSubviews];
}
@@ -523,6 +519,13 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
[_scrollView zoomToRect:rect animated:animated];
}
- (void)refreshContentInset
{
[RCTView autoAdjustInsetsForView:self
withScrollView:_scrollView
updateOffset:YES];
}
#pragma mark - ScrollView delegate
#define RCT_SCROLL_EVENT_HANDLER(delegateMethod, eventName) \