使用自定义组件来响应本机自动换行堆栈导航器标头

时间:2018-11-22 00:47:11

标签: reactjs react-native react-navigation

我想将react navigation头文件与react-native-linear-gradient一起使用来创建线性渐变头文件,我尝试将<LinearGradient>添加到node_modules文件夹中的堆栈导航头文件中,但无法正常工作,<SafeAreaView>在某种程度上阻止了<LinearGradient>的显示。

这是我尝试过的

<LinearGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={['#9DD295', '#35C5F1']} style={{ flex: 1 }}>
    {/* <View style={{ backgroundColor: 'red', width: '100%', height: '100%', flex: 1, flexGrow: 1, alignSelf: 'stretch', zIndex: 10000}}> */}
      <SafeAreaView forceInset={forceInset} style={containerStyles}>
          {background}
        <View style={styles.flexOne}>{appBar}</View>
      </SafeAreaView>
    {/* </View> */}
    </LinearGradient>
  </Animated.View>

0 个答案:

没有答案