标头下的渐变

时间:2018-10-05 09:47:23

标签: react-native

如何在标题下也为背景创建渐变?最好是在整个屏幕上,也在顶部栏中。

enter image description here

SignInScreen:

static navigationOptions = {
    headerStyle: {
        backgroundColor: 'transparent',
        position: 'absolute',
        top: 0,
        left: 0,
        right: 0,
        bottom: 0,
    }
};

render(){
    return(
        <LinearGradient colors={['#13547a', '#80d0c7']}  style={styles.linearGradient}>
            <View style={styles.container}>
                <LoginForm navigation={this.props.navigation} />
            </View>
        </LinearGradient>
    )
}

1 个答案:

答案 0 :(得分:0)

 static navigationOptions = {
    title: 'some string title',
    headerTitleStyle: {
    },
    headerStyle: {
       backgroundColor:'rgba(0,0,0,0.6)'
    },
    headerTintColor: {
    },
 }