Merge pull request #167 from mejackreed/add-touch-to-readme

add touch event information to readme
This commit is contained in:
Horcrux
2016-10-27 10:19:08 +08:00
committed by GitHub
2 changed files with 29 additions and 0 deletions
+29
View File
@@ -554,6 +554,35 @@ Code explanation:
![RadialGradient](./screenShoots/radialgradient.png)
#### Touch Events
Touch events are supported in react-native-svg. These include:
- `disabled`
- `onPress`
- `onPressIn`
- `onPressOut`
- `onLongPress`
- `delayPressIn`
- `delayPressOut`
- `delayLongPress`
You can use these events to provide interactivity to your react-native-svg components.
```html
<Circle
cx="50%"
cy="50%"
r="38%"
fill="red"
onPress={() => alert('Press on Circle')}
/>
```
![TouchEvents](./screenShoots/touchevents.gif)
For more examples of touch in action, checkout the [TouchEvents.js examples](Example/examples/TouchEvents.js).
### Run example:
```bash
Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB