Created
February 17, 2017 17:04
-
-
Save phrozenra/f38df22a04c2b86dcea2b6091e7dc9d2 to your computer and use it in GitHub Desktop.
react-navigation: full screen background with transparent status bar and nav bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PropTypes } from 'react' | |
import { Text, View } from 'react-native' | |
import BarButton, { BarButtonGroup } from '../../components/common/bar-button' | |
import Styles from '../../styles/login' | |
class SignIn extends React.Component { | |
static navigationOptions = { | |
header: (navigation) => ({ | |
visible: true, | |
style: Styles.navBar, | |
tintColor: 'white', | |
}), | |
} | |
render () { | |
return ( | |
<View style={Styles.container}> | |
<Text style={Styles.text}>All login / signup options are here</Text> | |
</View> | |
) | |
} | |
} | |
export default SignIn; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { StyleSheet } from 'react-native' | |
import CommonStyles from './common' | |
export default StyleSheet.create({ | |
navBar: { | |
backgroundColor: 'transparent', | |
}, | |
backgroundImage: { | |
resizeMode: 'cover', | |
width: null, | |
height: null, | |
backgroundColor: 'transparent', | |
flex: 1, | |
flexDirection: 'column', | |
}, | |
container: { | |
flex: 1, | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
text: { | |
color: 'white' | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use the image-background instead of image
<ImageBackground style={{height:'100%',width:'100%'}} />
<StatusBar
translucent={false}
backgroundColor={'transparent'}
barStyle={'light-content'}
/>