I am using react native elements Header to show my drawer, I am facing two problems:
1) My drawer does not cover entire top(header area). (As can be viewed in Picture the blue color not covering whole header)
2) How to add Image instead of Icon as I dont want to use react-native-vector-icons and how to add onPress() method on that Image, basically I want to add custom drawer image which onPress openDrawer.
This is my code:
import React, { Component } from 'react';
import { StyleSheet, Text, View,Image,TouchableOpacity, Alert } from 'react-native';
import Timeline from 'react-native-timeline-flatlist';
import {Header} from 'react-native-elements';
export default class HomeTimeTable extends Component {
render() {
//'rgb(45,156,219)'
return (
<View style={styles.container}>
<Header
placement="left"
leftComponent={{ icon: 'menu', color: '#fff' }}
centerComponent={{ text: 'MY TITLE', style: { color: '#fff' } }}
rightComponent={{ icon: 'home', color: '#fff' }}
/>
<Timeline
...
/>
</View>
);
}
}
This is my stylesheet:
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
backgroundColor: 'white',
},
list: {
flex: 1,
marginTop: 20,
},
drawer:{
width:20,
height:20,
justifyContent:"flex-start",
}
});