Skip to content

Commit

Permalink
Test and document Image resizeMode=center on iOS
Browse files Browse the repository at this point in the history
Summary:
`<Image resizeMode="center">` 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):

<img src=https://user-images.githubusercontent.com/2246565/35470720-44b38282-0357-11e8-941c-1b3c5a1b2f3b.png width=300>

react-native-website PR coming soon.

[IOS] [MINOR] [Image] - Include resizeMode=center in RNTester
Closes facebook/react-native#17759

Differential Revision: D6829051

Pulled By: hramos

fbshipit-source-id: c6e0000a75765e8bf3a1d0306aaafad002b14a58
  • Loading branch information
motiz88 authored and facebook-github-bot committed Jan 27, 2018
1 parent b5027a0 commit e3a7195
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions js/ImageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,18 +572,16 @@ exports.examples = [
/>
</View>
: null }
{ Platform.OS === 'android' ?
<View style={styles.leftMargin}>
<Text style={[styles.resizeModeText]}>
Center
</Text>
<Image
style={styles.resizeMode}
resizeMode={Image.resizeMode.center}
source={image}
/>
</View>
: null }
<View style={styles.leftMargin}>
<Text style={[styles.resizeModeText]}>
Center
</Text>
<Image
style={styles.resizeMode}
resizeMode={Image.resizeMode.center}
source={image}
/>
</View>
</View>
</View>
);
Expand Down

0 comments on commit e3a7195

Please sign in to comment.