mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Automatically adjust content inset after view controller did layout subviews
This commit is contained in:
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user