Fixed build eats

Reviewed By: skotchvail

Differential Revision: D8529938

fbshipit-source-id: 6a97d2c54757d7e75fe8731efe24704cf7fdf87c
This commit is contained in:
Hoa Dinh 2018-06-20 09:50:29 -07:00 committed by Facebook Github Bot
parent 746b503024
commit adb6929b36
1 changed files with 5 additions and 1 deletions

View File

@ -393,7 +393,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
// doesn't do weird things to UIScrollView insets automatically // doesn't do weird things to UIScrollView insets automatically
// and keeps it as an opt-in behavior. // and keeps it as an opt-in behavior.
if ([_scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) { if ([_scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
if (@available(iOS 11.0, *)) {
_scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
} }
#endif #endif
@ -1034,7 +1036,9 @@ RCT_SET_AND_PRESERVE_OFFSET(setScrollIndicatorInsets, scrollIndicatorInsets, UIE
// `contentInsetAdjustmentBehavior` is available since iOS 11. // `contentInsetAdjustmentBehavior` is available since iOS 11.
if ([_scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) { if ([_scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
CGPoint contentOffset = _scrollView.contentOffset; CGPoint contentOffset = _scrollView.contentOffset;
_scrollView.contentInsetAdjustmentBehavior = behavior; if (@available(iOS 11.0, *)) {
_scrollView.contentInsetAdjustmentBehavior = behavior;
}
_scrollView.contentOffset = contentOffset; _scrollView.contentOffset = contentOffset;
} }
} }