mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-24 03:35:43 +00:00
@@ -75,7 +75,7 @@
|
||||
|
||||
Here's a simple example. To render output like this:
|
||||
|
||||

|
||||

|
||||
|
||||
Use the following code:
|
||||
|
||||
@@ -191,7 +191,7 @@ The <Rect> element is used to create a rectangle and variations of a rectangle s
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Code explanation:
|
||||
|
||||
@@ -217,7 +217,7 @@ The <Circle> element is used to create a circle:
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Code explanation:
|
||||
|
||||
@@ -246,7 +246,7 @@ An ellipse is closely related to a circle. The difference is that an ellipse has
|
||||
/>
|
||||
</Svg>
|
||||
```
|
||||

|
||||

|
||||
|
||||
Code explanation:
|
||||
|
||||
@@ -275,7 +275,7 @@ The <Line> element is an SVG basic shape, used to create a line connecting two p
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Code explanation:
|
||||
|
||||
@@ -302,7 +302,7 @@ The <Polygon> element is used to create a graphic that contains at least three s
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Code explanation:
|
||||
|
||||
@@ -326,7 +326,7 @@ The <Polyline> element is used to create any shape that consists of only straigh
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Code explanation:
|
||||
|
||||
@@ -364,7 +364,7 @@ The following commands are available for path data:
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
#### Text
|
||||
@@ -388,7 +388,7 @@ The <Text> element is used to define text.
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
#### TSpan
|
||||
|
||||
@@ -416,7 +416,7 @@ The <TSpan> element is used to draw multiple lines of text in SVG. Rather than h
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
#### TextPath
|
||||
|
||||
@@ -453,7 +453,7 @@ In addition to text drawn in a straight line, SVG also includes the ability to p
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
#### G
|
||||
|
||||
@@ -496,7 +496,7 @@ The <G> element is a container used to group other SVG elements. Transformations
|
||||
</G>
|
||||
</Svg>
|
||||
```
|
||||

|
||||

|
||||
|
||||
#### Use
|
||||
|
||||
@@ -527,7 +527,7 @@ Before the <G> element can be referenced, it must have an ID set on it via its i
|
||||
|
||||
The <Use> element specifies where to show the reused shapes via its x and y props. Notice that the shapes inside the <G> element are located at 0,0. That is done because their position is added to the position specified in the <Use> element.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
#### Symbol
|
||||
@@ -566,7 +566,7 @@ The SVG <Symbol> element is used to define reusable symbols. The shapes nested i
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
#### Defs
|
||||
|
||||
@@ -621,7 +621,7 @@ The <Image> element allows a raster image to be included in an Svg componenet.
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
#### ClipPath
|
||||
|
||||
@@ -673,7 +673,7 @@ The <ClipPath> SVG element defines a clipping path. A clipping path is used/refe
|
||||
</Svg>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
#### LinearGradient
|
||||
|
||||
@@ -708,7 +708,7 @@ Code explanation:
|
||||
* The color range for a gradient can be composed of two or more colors. Each color is specified with a <Stop> tag. The offset prop is used to define where the gradient color begin and end
|
||||
* The fill prop links the ellipse element to the gradient
|
||||
|
||||

|
||||

|
||||
|
||||
*NOTICE:*
|
||||
LinearGradient also supports percentage as prop:
|
||||
@@ -754,7 +754,7 @@ Code explanation:
|
||||
* The color range for a gradient can be composed of two or more colors. Each color is specified with a <stop> tag. The offset prop is used to define where the gradient color begin and end
|
||||
* The fill prop links the ellipse element to the gradient
|
||||
|
||||

|
||||

|
||||
|
||||
#### Touch Events
|
||||
|
||||
@@ -781,7 +781,7 @@ You can use these events to provide interactivity to your react-native-svg compo
|
||||
/>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
For more examples of touch in action, checkout the [TouchEvents.js examples](https://github.com/magicismight/react-native-svg-example/blob/master/examples/TouchEvents.js).
|
||||
|
||||
|
||||
@@ -44,6 +44,11 @@ public class SvgPackage implements ReactPackage {
|
||||
new SvgViewManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
||||
return Collections.<NativeModule>singletonList(new SvgViewModule(reactContext));
|
||||
|
||||
Reference in New Issue
Block a user