react-native-async-image-animated
react-native-async-image-animated copied to clipboard
Image width not getting stretched
I absolutely love your work... but one problem I want the image to be stretched to full screen...
The placeholder fits well but the image after loading even though it's width is greater than the window's width... I saw the source code where the resizeMode is "contain" in all cases... in some cases you would want the "cover" value....
Please help!!!! Thanks in advance
Modify the AsyncImageAnimated.js source code, like this: `
{!failed &&
<react_native_1.Animated.Image key={imageKey} source={source} resizeMode={'contain'} style={[
style,
{
opacity: imageOpacity,
position: 'absolute',
resizeMode: 'cover',
},
]} onLoad={this.onLoad} onError={this.onError}/>}
{(placeholderSource && !loaded) &&
<react_native_1.Animated.Image source={placeholderSource} style={[
style,
{
opacity: placeholderOpacity,
position: 'absolute',
resizeMode: 'cover',
},
]}/>}}/>}
`
Can this be made a prop? resizeMode
Yes please ... it can be made a prop... that would perfectly solve my problem @alexborton
hey yo, @wmcbain , please add resizeMode
to prop.
and, could you set the height/width to option?
you can give it '100%' default value.
@geminiyellow Will go through this weekend and make requested changes from everyone. Or feel free to submit a PR if you need it earlier.
hmm... ok, 1 month later ...
@geminiyellow Feel free to open a PR thanks. :)
I made a PR. https://github.com/ZXVentures/react-native-async-image-animated/pull/6