try to implement stroke text with gradient but failed

try to implement stroke text with gradient but failed
This commit is contained in:
Horcrux
2016-04-23 11:53:48 +08:00
parent 2eda0e8ce2
commit d990eaa472
3 changed files with 41 additions and 9 deletions
+1 -1
View File
@@ -3,4 +3,4 @@ rootProject.name = 'ArtSvgExample'
include ':app'
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-art-svg/android')
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
+5 -4
View File
@@ -7,7 +7,8 @@ import Svg, {
LinearGradient,
Stop,
Defs,
ClipPath
ClipPath,
Rect
} from 'react-native-svg';
class TextExample extends Component{
@@ -96,11 +97,11 @@ class TextStroke extends Component{
>
<Defs>
<LinearGradient id="grad" x1="0" y1="0" x2="100" y2="0">
<Stop offset="100%" stopColor="rgb(255,255,0)" stopOpacity="0" />
<Stop offset="0%" stopColor="red" stopOpacity="1" />
<Stop offset="100%" stopColor="#fff" stopOpacity="0" />
<Stop offset="0%" stopColor="#000" stopOpacity="1" />
</LinearGradient>
</Defs>
<Rect x="0" y="0" width="200" height="60" fill="blue" />
<Text
stroke="url(#grad)"
strokeWidth="4"