mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 01:00:43 +00:00
Merge pull request #167 from mejackreed/add-touch-to-readme
add touch event information to readme
This commit is contained in:
@@ -554,6 +554,35 @@ Code explanation:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
#### 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')}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
For more examples of touch in action, checkout the [TouchEvents.js examples](Example/examples/TouchEvents.js).
|
||||||
|
|
||||||
### Run example:
|
### Run example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 123 KiB |
Reference in New Issue
Block a user