I integrate DrawerNavigator in my project. its working fine, but there are no any property to set background image. How can I will add background image in DrawerNavigator.
Code of DrawerNavigation
import { AppRegistry , Dimensions} from 'react-native';
import Library from './ViewControllers/Library';
import Language from './ViewControllers/Language';
import AboutUS from './ViewControllers/AboutUS';
import Support from './ViewControllers/Support';
import { DrawerNavigator } from 'react-navigation';
const MyApp = DrawerNavigator({
Library: {
screen: Library,
},
Language: {
screen: Language,
},
AboutUS: {
screen: AboutUS,
},
Support: {
screen: Support,
},
},{
initialRouteName:'Library',
drawerWidth: Dimensions.get('window').width / 2.0,
drawerPosition: 'left',
useNativeAnimations : false,
drawerBackgroundColor : 'white',
contentOptions: {
activeTintColor: 'black',
activeBackgroundColor : 'transparent',
inactiveTintColor : 'black',
itemsContainerStyle: {
marginVertical: 0,
},
iconContainerStyle: {
opacity: 1
},
itemStyle :{
height : 50,
}
},
}
);
AppRegistry.registerComponent('Basair', () => MyApp);
Found solution to the background image to the drawer navigation here's my code
the end result
we can provide the custom
contentComponent
for DrawerNavigator. See the below code.Code :
Set background of Drawer: