React Native Fit Image
React Native Fit Image enables you to draw responsive image component.
Introduction
Responsive image component to fit perfectly itself.
Install
npm install react-native-fit-image --save
Usage
var styles = StyleSheet.create({
fitImage: {
borderRadius: 20,
},
fitImageWithSize: {
height: 100,
width: 30,
},
});
<FitImage
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }}
style={styles.fitImage}
/>
<FitImage
indicator
indicatorColor="white" // react native colors or color codes like #919191
indicatorSize="large" // (small | large) or integer
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }}
style={styles.fitImage}
/>
<FitImage
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }}
originalWidth={400}
originalHeight={400}
style={styles.fitImage}
/>
<FitImage
resizeMode="contain"
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }}
/>
<FitImage
source={{ uri: 'http://facebook.github.io/react/img/logo_og.png' }}
style={styles.fitImageWithSize}
/>
<FitImage
source={require('fit-image.png')}
style={styles.fitImageWithSize}
/>
Example