I am trying to use NativeBase with ReactNative and have a picture as the background. I've been googling for a while and here is the code I've come up with:
export default class WelcomeScreen extends Component {
render(){
return (
<Container>
<Header>
<Button transparent>
<Icon name='ios-arrow-back' />
</Button>
</Header>
<Content>
<Image source={require('../images/telula_upclose.jpeg')} style={styles.backgroundImage} />
<Text>Do you ever feel like you dont have a partner</Text>
</Content>
</Container>
);
}
}
let styles = StyleSheet.create({
backgroundImage: {
flex: 1,
backgroundColor:'transparent',
justifyContent: 'center',
alignItems: 'center',
}
});
The problem is that this stretches the image a great deal so that it's unrecognizable in the simulator. Here's a picture of what's in the simulator compared to the actual image:
and here's the actual image:
How do I fix this?