react-native/Libraries/Components
Adam Miskiewicz 6e28b39d78 Add 'contentInsetAdjustmentBehavior' (new in iOS 11) to ScrollView
Summary:
In iOS11, Apple added a new layout feature called "Safe Areas" (this blog post talks a bit about it: https://www.bignerdranch.com/blog/wwdc-2017-large-titles-and-safe-area-layout-guides/).

UIScrollView is one component that is affected by this change in Apple's API. When the `contentInsetAdjustmentBehavior` is set to `automatic`, for example, it will adjust the insets (and override any manually set insets) automatically based on whether or not there's a UINavigationBar, a UITabBar, a visible status bar, etc on the screen. Frustratingly, Apple decided to default to `Automatic` for this behavior, which will cause any apps that set contentInset/contentContainerStyle padding to have their values offset by, at the very least, the size of the status bar, when they compile their app for iOS 11. Here's more information about this behavior: https://developer.apple.com/documentation/uikit/uiscrollview/2902261-contentinsetadjustmentbehavior?language=objc

Mostly, this is a really straightforward change -- it simply adds a new iOS-only prop to ScrollView that allows setting `contentInsetAdjustmentBehavior`. But I did decide to default the behavior to `never`, so that it mimics the behavior we've seen in iOS < 11. I think it's good to keep something as crucial as scrollview content insets non-magical, and also keep it behaving similarly between platforms.
Closes https://github.com/facebook/react-native/pull/15023

Differential Revision: D5441491

Pulled By: shergin

fbshipit-source-id: 7b56ea290f7f6eca5f1d996ff8488f40b866c2e6
2017-07-25 10:28:42 -07:00
..
AccessibilityInfo iOS: Introduce API for making screen reader announcements 2017-05-30 04:46:08 -07:00
ActivityIndicator Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
AppleTV Update remaining PropTypes references 2017-06-12 16:03:09 -07:00
Clipboard Remove deprecated APIs and modules 2016-10-11 07:43:52 -07:00
DatePicker Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
DatePickerAndroid Fixed a typo in open function documentation 2017-04-18 15:36:20 -07:00
DrawerAndroid Update DrawerLayoutAndroid.android.js 2017-07-24 08:16:25 -07:00
Keyboard Libraries/Shared --> Libraries/www-shared, EventEmitter --> vendor/emitter 2017-07-21 09:40:15 -07:00
MaskedView use propTypes directly 2017-07-20 03:19:45 -07:00
Navigation Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
Picker Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
ProgressBarAndroid Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
ProgressViewIOS Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
RefreshControl Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
ScrollView Add 'contentInsetAdjustmentBehavior' (new in iOS 11) to ScrollView 2017-07-25 10:28:42 -07:00
SegmentedControlIOS Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
Slider Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
StatusBar Fix type of StatusBar backgroundColor so it is displayed correctly in docs 2017-07-07 20:33:31 -07:00
Switch Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
TabBarIOS Ran PropTypes -> prop-types codemod against Libraries/FBReactKit/js/react-native-github 2017-04-12 16:15:15 -07:00
TextInput Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
TimePickerAndroid Clean unused import modules. 2016-10-16 11:13:40 -07:00
ToastAndroid Add very basic usage example for android toast 2016-09-19 06:43:54 -07:00
ToolbarAndroid Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
Touchable Docs: Update TouchableWithoutFeedback.js 2017-07-17 20:31:47 -07:00
UnimplementedViews Make UnimplementedView invisible in prod 2017-06-06 09:45:15 -07:00
View Adds hook for platform-specific View props 2017-07-24 12:26:58 -07:00
ViewPager add peeking feature in AndroidViewPage(RN) 2017-06-30 22:21:06 -07:00
WebView Fix scalesPageToFit default property for iOS WebView. 2017-06-29 01:00:39 -07:00
Button.js Clearer code in Button.js 2017-06-27 11:33:34 -07:00
LazyRenderer.js Replace React.createClass with create-react-class 2017-07-07 14:36:01 -07:00
ScrollResponder.js Add support for flashScrollIndicators on iOS 2017-06-06 13:06:48 -07:00
StaticContainer.react.js Rename files to match @providesModule annotations 2017-02-03 15:58:58 -08:00
StaticRenderer.js Ran PropTypes -> prop-types codemod against Libraries/FBReactKit/js/react-native-github 2017-04-12 16:15:15 -07:00
Subscribable.js [ReactNative] clean lint for Libraries/Components 2015-05-18 15:54:07 -08:00