GithubHelp home page GithubHelp logo

Comments (4)

iMonk777 avatar iMonk777 commented on May 29, 2024

I've had the same issue on IOS.
I manage to fix it by using the renderImage prop, and render my own image component. @Yandamuri

from react-native-image-viewer.

Yandamuri avatar Yandamuri commented on May 29, 2024

@iMonk777 Able to render image , but it's size is very small as shown below,

IMG_0017

And this is how I rendered

  return (
		<View style={{flex: 1}}>
			<ImageViewer 
                                   imageUrls={images}
                                   renderImage={() => <Image style={{height: '100%', width: '100%'}} resizeMode={'contain'} source={{uri:`${axios.defaults.baseURL}${url}`, headers}} />}
                                   enableImageZoom={true}
                                   backgroundColor={TEXT_HEADERBLACK}
                                   maxOverflow={0}
                                   renderIndicator={() => <></>}
                             />
		</View>
);

What changes should I do to make image fit to the screen?

from react-native-image-viewer.

iMonk777 avatar iMonk777 commented on May 29, 2024

Tried the same code as yours @Yandamuri , And it works for me. It is probably related to your image resolution? Maybe try a bigger resolution image from google, just for testing.
Also, if you have an array of images, the URL for each image can be taken from the source, like below

 renderImage={({ source }) => (
                            <Image
                                source={source} //here my source is an object {uri: 'my image link'}
                                style={styles.image}
                            />
                        )}

from react-native-image-viewer.

Yandamuri avatar Yandamuri commented on May 29, 2024

@iMonk777 I have tried multiple hd images like 750 × 1334 But still result is same. Strange thing is Images are rendering as expected in android. Problem is with iOS only. Tried in both Simulator and real device. But result is same.

Did you try in iOS?

Any guess that why it is not working in iOS?

from react-native-image-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.