From be7037fd8e1c4b92646caf7a70b9d6d28ef2c30a Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Sat, 27 Jan 2018 11:29:52 -0800 Subject: [PATCH] Test and document Image resizeMode=center on iOS Summary: `` already works on iOS (implemented in #8792), but is neither tested nor documented the way the other `resizeMode` values are. This PR primarily enables the relevant RNTester case on iOS, and secondarily copies over the doc comment from `Image.android.js` to `Image.ios.js`. A PR to `react-native-website` will follow shortly and it is there I will try and revise the wording a bit. Updated RNTester screenshot (iOS): react-native-website PR coming soon. [IOS] [MINOR] [Image] - Include resizeMode=center in RNTester Closes https://github.com/facebook/react-native/pull/17759 Differential Revision: D6829051 Pulled By: hramos fbshipit-source-id: c6e0000a75765e8bf3a1d0306aaafad002b14a58 --- Libraries/Image/Image.ios.js | 4 ++++ RNTester/js/ImageExample.js | 22 ++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index fd99b986b..f8ae5a172 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -241,6 +241,10 @@ const Image = createReactClass({ * * - `repeat`: Repeat the image to cover the frame of the view. The * image will keep it's size and aspect ratio. (iOS only) + * + * - 'center': Scale the image down so that it is completely visible, + * if bigger than the area of the view. + * The image will not be scaled up. */ resizeMode: PropTypes.oneOf([ 'cover', diff --git a/RNTester/js/ImageExample.js b/RNTester/js/ImageExample.js index 6e6778904..7577b5b34 100644 --- a/RNTester/js/ImageExample.js +++ b/RNTester/js/ImageExample.js @@ -572,18 +572,16 @@ exports.examples = [ /> : null } - { Platform.OS === 'android' ? - - - Center - - - - : null } + + + Center + + + );