React Native Image is not showing. What is the reason. I checked several answers on stackoverflow, but no answer helped me.
The problem is that image doesn't show on android, but on iOS. What is the reason? That is my code.
import React, { Component } from 'react';
import { View, Image } from 'react-native';
export default class ImageTest extends Component {
constructor(props) {
super(props);
this.state = {
};
}
render() {
return (
<View style={{ flex: 1 }}>
<Image
source={{ uri: 'https://reactnative.dev/img/tiny_logo.png' }}
style={{ width: 200, height: 100, resizeMode: 'stretch' }} />
<Image
source={require('../assets/logo.png')}
style={{ width: 200, height: 100, resizeMode: 'stretch' }} />
<Image
style={{ width: 200, height: 100, resizeMode: 'stretch' }}
source={{
uri:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg==',
}}
/>
</View>
);
}
}