Reactjs 如何在expo react native中的borderColor上添加线性渐变色?
在边框上添加线性渐变颜色 我想知道如何在样式表中使用线性渐变Reactjs 如何在expo react native中的borderColor上添加线性渐变色?,reactjs,react-native,colors,expo,gradient,Reactjs,React Native,Colors,Expo,Gradient,在边框上添加线性渐变颜色 我想知道如何在样式表中使用线性渐变 borderColor:['color1',color2] 请检查输出图像 让我们从创建一个新按钮开始: <TouchableOpacity onPress={() => {})} style={styles.buttonContainer}> <Text style={style.buttonText}>Login</Text> 首先安装react native linear gr
borderColor:['color1',color2]
请检查输出图像
让我们从创建一个新按钮开始:
<TouchableOpacity
onPress={() => {})}
style={styles.buttonContainer}>
<Text style={style.buttonText}>Login</Text>
首先安装react native linear gradient包
<LinearGradient
colors={['#00FFFF', '#17C8FF', '#329BFF', '#4C64FF', '#6536FF', '#8000FF']}
start={{x: 0.0, y: 1.0}} end={{x: 1.0, y: 1.0}}
style={{ height: 48, width: 200, alignItems: 'center', justifyContent: 'center', width: 200}}
>
有关详细信息:要添加线性渐变,请先运行
expo添加expo线性渐变
然后为了增加水平梯度
<LinearGradient
start={[0, 1]}
end={[1, 0]}
colors={[color1, color2]}
/>
<LinearGradient
start={[0, 0]}
end={[0, 1]}
colors={[color1, color2]}
/>
垂直梯度
<LinearGradient
start={[0, 1]}
end={[1, 0]}
colors={[color1, color2]}
/>
<LinearGradient
start={[0, 0]}
end={[0, 1]}
colors={[color1, color2]}
/>
我想要边框上的渐变色