I am making a custom drawer navigation for my app. Where I am using background image (it will not take full space), on the background image I am using another image. After that I have to show some content below background image.
This is the component I made for drawer navigation. I am not sure if this is the right approach. you can get the immediate result by pasting this code in expo app.
import React from 'react';
import { View, Text, Button, ImageBackground, Image } from 'react-native';
class Sidebar extends React.Component {
render() {
return (
<ImageBackground source={{uri: 'https://images.pexels.com/photos/1738762/pexels-photo-1738762.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'}} style={{ width: '100%', height: '60%' }}>
<Image source={{uri: 'https://facebook.github.io/react/logo-og.png'}} style={{width: 200, height: 200, marginLeft: 20}} />
<Text style={{marginTop: 70, marginLeft: 20}}>Information</Text>
<Text style={{marginTop: 10, marginLeft: 20}}>Settings</Text>
<Text style={{marginTop: 10, marginLeft: 20}}>Favorite</Text>
</ImageBackground>
);
}
}
export default Sidebar
What would be the better way to get this kind of result. is this ok give as much margin to my text that it come below the background image