Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在自然艺术造型笔划中使用渐变色_Android_Ios_Svg_React Native - Fatal编程技术网

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