Skip to content

Commit

Permalink
disable new iOS 13 behavior automaticallyAdjustsScrollIndicatorInsets
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwh committed May 6, 2021
1 parent 438a4cf commit da80e37
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions React/Views/ScrollView/RCTScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,16 @@ - (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDis
}
#endif

#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
// `automaticallyAdjustsScrollIndicatorInsets` is available since iOS 13.
// We set the default behavior to NO to match iOS <13 behavior.
if ([_scrollView respondsToSelector:@selector(setAutomaticallyAdjustsScrollIndicatorInsets:)]) {
if (@available(iOS 13.0, *)) {
_scrollView.automaticallyAdjustsScrollIndicatorInsets = NO;
}
}
#endif

_automaticallyAdjustContentInsets = YES;
_contentInset = UIEdgeInsetsZero;
_lastClippedToRect = CGRectNull;
Expand Down

0 comments on commit da80e37

Please sign in to comment.