您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

rn_vshot.native.js 888B

123456789101112131415161718192021222324252627282930313233343536
  1. import ViewShot,{ captureScreen,captureRef } from "react-native-view-shot";
  2. // import { captureScreen,captureRef } from "react-native-view-shot";
  3. import React, { PureComponent,Component} from 'react';
  4. import { Header, LoadingIndicator, Text } from '../react/features/base/react';
  5. class ExampleCaptureOnMountManually extends Component {
  6. componentDidMount () {
  7. // captureScreen
  8. // this.refs.viewShot.capture().then(uri => {
  9. this.refs.captureScreen.capture().then(uri => {
  10. console.log("\n\ndo something with ", uri);
  11. });
  12. }
  13. render() {
  14. // <ViewShot ref="viewShot" options={{ format: "jpg", quality: 0.9 }}>
  15. return (
  16. <ViewShot ref="captureScreen" options={{ format: "jpg", quality: 0.9 }}>
  17. <Text style={{background:"red"}}>...Something to rasterize...</Text>
  18. </ViewShot>
  19. );
  20. }
  21. }
  22. export {ExampleCaptureOnMountManually}