Skip to content

React native component to resize and display images downloaded from network. It allows dynamic height and width for images downaloded from network.

License

Notifications You must be signed in to change notification settings

vivekkhurana/react-native-network-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

React Native Network Image

In your componenet import NetworkedImage

import NetworkedImage from 'react-native-network-image'

Define a function to calculate the height and width of resized image

calcImage(downlodImageWidth,downloadImageHeight){
      
      //Perform your calculations
        
	// Return the final dimensions of image to be displayed
        return {width:newwidth,height:newheight}
  }

Call NetworkedImage componenet in your render method

render(){
	return (
		<View>
		//pass the image dimension calculation function in the callback prop
		<NetworkedImage source={{uri:imageURI}} 
                             resizeMode={Image.resizeMode.contain} 
                            callback={this.calcImage} />
		</View>
	)
}	

About

React native component to resize and display images downloaded from network. It allows dynamic height and width for images downaloded from network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published