How come when I use a network image,
<View style={{flex: 1, alignItems: 'stretch'}}>
<Image
style={{flex: 1}}
source={{uri: 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png'}} />
</View>
but when I use require() for a static image:
<View style={{flex: 1, alignItems: 'stretch'}}>
<Image
style={{flex: 1}}
source={require('./googlelogo.png')} />
</View>
Running react-native 0.37.0. This code was added straight into a freshly react-native init
-ed project, no 3rd party libraries or anything.
Probably you were having the same issue as this.
Try setting the Image's width to null
:
<Image
style={{flex: 1, width: null}}
source={require('./googlelogo.png')} />