我想将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>