mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-08-15 18:45:06 +00:00
@@ -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 }
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user