Image: set 'resizeMode' default to 'stretch'

Fix #8
This commit is contained in:
Nicolas Gallagher
2015-09-08 00:29:53 -07:00
parent edf0fda75a
commit c72173ff88
2 changed files with 8 additions and 9 deletions
+2 -2
View File
@@ -37,10 +37,10 @@ Invoked when load either succeeds or fails,
Invoked on load start.
**resizeMode** oneOf('clip', 'contain', 'cover', 'stretch')
**resizeMode** oneOf('contain', 'cover', 'none', 'stretch')
Determines how to resize the image when the frame doesn't match the raw image
dimensions. Default: `cover`.
dimensions. Default: `stretch`.
**source** { uri: string }
+6 -7
View File
@@ -17,8 +17,7 @@ const styles = {
initial: {
alignSelf: 'flex-start',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
backgroundSize: 'cover'
backgroundPosition: 'center'
},
img: {
borderWidth: 0,
@@ -35,15 +34,15 @@ const styles = {
top: 0
},
resizeMode: {
clip: {
backgroundSize: 'auto'
},
contain: {
backgroundSize: 'contain'
},
cover: {
backgroundSize: 'cover'
},
none: {
backgroundSize: 'auto'
},
stretch: {
backgroundSize: '100% 100%'
}
@@ -71,7 +70,7 @@ class Image extends React.Component {
onLoad: PropTypes.func,
onLoadEnd: PropTypes.func,
onLoadStart: PropTypes.func,
resizeMode: PropTypes.oneOf(['clip', 'contain', 'cover', 'stretch']),
resizeMode: PropTypes.oneOf(['contain', 'cover', 'none', 'stretch']),
source: PropTypes.object,
style: PropTypes.shape(ImageStylePropTypes),
testID: CoreComponent.propTypes.testID
@@ -82,7 +81,7 @@ class Image extends React.Component {
static defaultProps = {
accessible: true,
defaultSource: {},
resizeMode: 'cover',
resizeMode: 'stretch',
source: {},
style: styles.initial
}