react-native-async-image-animated icon indicating copy to clipboard operation
react-native-async-image-animated copied to clipboard

Image width not getting stretched

Open sarathvad1811 opened this issue 6 years ago • 8 comments

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

sarathvad1811 avatar Apr 06 '18 09:04 sarathvad1811

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',
            },
        ]}/>}}/>}

`

peppermints avatar May 10 '18 09:05 peppermints

Can this be made a prop? resizeMode

alexborton avatar Jun 18 '18 11:06 alexborton

Yes please ... it can be made a prop... that would perfectly solve my problem @alexborton

sarathvad1811 avatar Jun 30 '18 09:06 sarathvad1811

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 avatar Oct 24 '18 08:10 geminiyellow

@geminiyellow Will go through this weekend and make requested changes from everyone. Or feel free to submit a PR if you need it earlier.

wmcbain avatar Oct 30 '18 16:10 wmcbain

hmm... ok, 1 month later ...

geminiyellow avatar Nov 29 '18 02:11 geminiyellow

@geminiyellow Feel free to open a PR thanks. :)

wmcbain avatar Dec 02 '18 16:12 wmcbain

I made a PR. https://github.com/ZXVentures/react-native-async-image-animated/pull/6

drewdulz avatar Jan 23 '19 03:01 drewdulz