react-native/React
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
..
Base Apple TV: Enable long presses on TV remote; dev menu on TV device; example code 2017-07-31 04:06:32 -07:00
CxxBridge RCTCxxBridge: Use C++ atomic 2017-07-31 03:35:18 -07:00
CxxModule Replace exported method registration with statically allocated struct 2017-07-24 07:01:53 -07:00
CxxUtils More efficient dynamic->NSString conversion. 2017-07-26 18:31:12 -07:00
DevSupport Apple TV: Enable long presses on TV remote; dev menu on TV device; example code 2017-07-31 04:06:32 -07:00
Executors Add more information to `__fbBatchedBridge is undefined` error 2017-07-26 11:21:59 -07:00
Inspector Reduce log level for connection errors 2017-07-28 18:31:22 -07:00
Modules Fix typo in RCTDevSettings.mm 2017-07-28 11:49:42 -07:00
Profiler Mark non-extern strings static 2017-07-25 04:49:46 -07:00
React.xcodeproj Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
ReactLegacy.xcodeproj Standardize project indentation settings on 2 spaces 2017-07-31 05:20:03 -07:00
Views Add 'contentInsetAdjustmentBehavior' (new in iOS 11) to ScrollView 2017-07-31 12:23:34 -07:00
third-party.xcconfig More attempts to fix Travis CI runs 2017-05-10 04:32:54 -07:00