react-native/Libraries
Adam Miskiewicz 1954438533 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

Reviewed By: javache

Differential Revision: D5517552

Pulled By: hramos

fbshipit-source-id: c9ce4bf331b3d243228268d826fdd4dcee99981d
2017-07-31 12:23:34 -07:00
..
ART Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
ActionSheetIOS Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Alert Export Alert's type ButtonsArray for external use 2017-03-06 12:44:47 -08:00
Animated Native Animated - Override __makeNative in AnimatedInterpolation 2017-07-18 18:02:22 -07:00
AppState Added stubs for some native modules 2017-06-01 08:31:19 -07:00
BatchedBridge Increase information logged to MessageQueue.spy 2017-07-31 06:16:41 -07:00
Blob Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
BugReporting Patch up for future React Sync 2017-02-08 14:50:43 -08:00
CameraRoll Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Components Add 'contentInsetAdjustmentBehavior' (new in iOS 11) to ScrollView 2017-07-31 12:23:34 -07:00
Core Add blob implementation with WebSocket integration 2017-07-26 08:23:20 -07:00
EventEmitter Breaking - make RCTDeviceEventEmitter warnings fatal 2017-07-24 03:47:59 -07:00
Experimental Support for preventing swipe left or swipe right 2017-07-07 20:03:20 -07:00
Geolocation Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Image Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Inspector Use fixed point in inspector 2017-07-06 14:52:28 -07:00
Interaction Increase information logged to MessageQueue.spy 2017-07-31 06:16:41 -07:00
JSInspector Add Network agent 2016-11-02 12:29:15 -07:00
LayoutAnimation Fix prop-types warning in LayoutAnimation 2017-05-12 15:06:17 -07:00
Linking Docs: fix typo in deeplinking docs 2017-07-26 07:18:44 -07:00
LinkingIOS Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Lists Fix SectionList examples in documentation 2017-07-28 12:49:01 -07:00
Modal Update Modal.js 2017-07-26 07:18:44 -07:00
NativeAnimation Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Network Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Performance Cleanup ifdef's in JSCExecutor 2017-07-25 05:02:03 -07:00
PermissionsAndroid Include Create React Native App in Getting Started 2017-04-26 07:16:18 -07:00
PushNotificationIOS Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
RCTTest Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
ReactNative Support native ViewManager inheritance on iOS 2017-07-10 16:01:12 -07:00
Renderer React sync for revisions cb32253...5495e49 2017-07-13 17:38:57 -07:00
Sample Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Settings Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Share Flowify Process Color 2017-04-26 11:31:56 -07:00
Storage correctly order ASyncStorage 2017-02-21 15:18:40 -08:00
StyleSheet update docs for Transforms 2017-07-28 12:49:01 -07:00
Text Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Utilities gets Relay/Classic/Compat building 2017-07-24 21:39:00 -07:00
Vibration Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
WebSocket Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
polyfills Remove default polyfills from metro-bundler 2017-07-17 03:20:02 -07:00
react-native Breaking - Remove AdSupportIOS 2017-07-26 13:32:41 -07:00
vendor gets Relay/Classic/Compat building 2017-07-24 21:39:00 -07:00
Promise.js Don't require prettyFormat in every single bundle. 2017-06-16 04:31:56 -07:00
promiseRejectionIsError.js RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00