ascoders / react-native-image-viewer

🚀 tiny & fast lib for react native image viewer pan and zoom
MIT License
2.44k stars 577 forks source link

RN 0.60 Image not showing, only show the black background #382

Closed ethanloh95 closed 4 years ago

ethanloh95 commented 4 years ago
Screenshot 2020-03-11 at 4 44 29 PM

Exist on android and ios phone

Can someone give a solution, thanks

ethanloh95 commented 4 years ago

I found the solution

use renderImage to display the image

devanshsadhotra25 commented 4 years ago

I found the solution

use renderImage to display the image

can u please quote an example, how did u achieve this?

sam9010 commented 4 years ago

@devanshsadhotra25 @XELoh can you example for me?

sam9010 commented 4 years ago

it is a sample code...

`<ImageViewer index={this.state.imageViewerIndex} imageUrls={this.state.imageDownload1} enablePreload={true} renderHeader={() => ( <TouchableOpacity onPress={() => this.setState({ isShowImageZoom : false })} style={{ alignItem: 'right',backgroundColor:'#1111' }}

<Text style={{ color: '#F7F7FA', fontSize: 15, fontFamily: 'font' }}>X )}

                        loadingRender={() => (
                            <ActivityIndicator
                                color={'#FFA800'}
                                size="large"
                                style={{
                                    height: Dimensions.get('window').height,
                                    alignItems: 'center',
                                    justifyContent: 'center',
                                }}
                            />
                        )}
                        renderImage={(props) => (
                            <Image
                            style={{
                            width: 400,
                            height: 400,
                            alignItems: 'center',
                            alignContent: 'center',
                            justifyContent: 'center',
                        }}
                            resizeMode="contain"
                            source={{uri: `data:image/gif;base64,${this.state.imageDownload}`}}
                            />
                        )}
                    />`
sjonchhe commented 3 years ago

have you passed height width white creating this array this.state.imageDownload1 ??