I'm having some trouble with React Native. I have a screen where I need to have a custom header (with icons and more stuff), so in the navigationOptions
I'll be using headerTitle
instead of title
.
The problem is, when using a headerTitle
, the status bar is not included in the component. So I have something like this:
headerTitle: () => <MyHeader />
and then:
const MyHeader = props => {
return(
<View style={{flex: 1, backgroundColor: 'red', height: '100%', padding: 10, justifyContent: 'center'}}>
<Text style={{color: 'white'}}>Testing</Text>
</View>
)
}
And I get this:
I tried doing this:
How to set iOS status bar background color in React Native?
But didn't work.
This is my intended result:
I can do it using headerStyle
and headerTitleStyle
in navigationOptions
but then I can't use a custom component...