我使用图书馆反应原生甲板刷卡能够刷卡。我希望我的屏幕具有线性渐变背景颜色,但问题是如果设置了背景颜色,它似乎不会继承线性渐变颜色。swiper 库有一个 backgroundColor 属性,但默认为蓝色,因此不渲染线性渐变。所以我的问题是,这可以被覆盖/线性渐变可以变成背景颜色吗?我下面的代码供参考
<View style={styles.Scontainer}>
<LinearGradient
colors={[
"#F7BBB2",
"#FFC9B5",
"#FFDDC7",
"#FFF6D4",
"#FFFDF2",
]}
style={styles.background}
// Linear Gradient
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 1 }}
>
<Swiper
cards={data}
renderCard={(card) => {
return (
<View style={styles.card}>
<Text style={styles.text}>Hello world</Text>
</View>
);
}}
cardIndex={0}
infinite={true}
horizontalSwipe={false}
goBackToPreviousCardOnSwipeBottom={true}
showSecondCard={true}
disableBottomSwipe={true}
// backgroundColor= "linearGradient? -> style prop
></Swiper>
</LinearGradient>
</View>