Skip to content

Commit e3fde2d

Browse files
committed
Add ScrollView example
1 parent 796c341 commit e3fde2d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,27 @@ class ExampleWaitingCapture extends Component {
6363
}
6464
}
6565
```
66+
## With ScrollView
67+
```js
68+
import ViewShot from "react-native-view-shot";
6669

70+
class ExampleCaptureOfScrollView extends Component {
71+
componentDidMount () {
72+
this.refs.viewShot.capture().then(uri => {
73+
console.log("do something with ", uri);
74+
});
75+
}
76+
render() {
77+
return (
78+
<ScrollView>
79+
<ViewShot ref="viewShot" options={{ format: "jpg", quality: 0.9 }}>
80+
... All content of the ScrollView ...
81+
</ViewShot>
82+
</ScrollView>
83+
);
84+
}
85+
}
86+
```
6787
**Props:**
6888

6989
- **`children`**: the actual content to rasterize.

0 commit comments

Comments
 (0)