Android 如何在自然艺术造型笔划中使用渐变色
我想做一个渐变色进度条。 这是我的密码Android 如何在自然艺术造型笔划中使用渐变色,android,ios,svg,react-native,Android,Ios,Svg,React Native,我想做一个渐变色进度条。 这是我的密码 const linearGradient = new LinearGradient({ '0': '#EC6474', '1': '#7F5CFA' }, "0", "0", "300", "0" ); <Surface width={this.props.style.width} height={this.props.style.height}>
const linearGradient = new LinearGradient({
'0': '#EC6474',
'1': '#7F5CFA'
},
"0", "0", "300", "0"
);
<Surface
width={this.props.style.width}
height={this.props.style.height}>
<Group>
<Shape
d={this.state.backgroundPath}
strokeWidth={this.props.backgroundLineHeight}
stroke='#aaaaab'
strokeCap="square"
strokeJoin="miter"/>
<Shape
d={this.state.abovePath}
strokeWidth={this.props.aboveLineHeight}
stroke={linearGradient}
strokeCap="butt" strokeJoin="bevel"/>
</Group>
</Surface>
const linearGradient=新的linearGradient({
“0”:“EC6474”,
“1”:“7F5CFA”
},
"0", "0", "300", "0"
);
但它抛出了一个错误:
无法读取null的属性“slice”
它是不是支持梯度
我知道svg可以做到这一点
但我还是想用React Native