Closed Akshaybagai52 closed 1 year ago
Above one is full code for signature screen whenever i'm drawing vertical line then i'm getting dots on screen but whenever i'm drawing horizontal lines then it is working fine is there any issue ?
you can use scrollEnabled props in the ScrollView, when onBegin triggered you can set scrollEnabled with false, when onEnd triggered you can set scrollEnabled with true same with https://github.com/YanYuanFE/react-native-signature-canvas/issues/11#issuecomment-643923851
import React, { useRef } from 'react'; import { View, StyleSheet, Button } from 'react-native'; import SignatureCanvas, { SignatureViewRef } from 'react-native-signature-canvas';
export const MySignatureCanvas: React.FC = () => { const signatureRef = useRef(null); // Create a ref for the signature canvas
const handleClearSignature = () => { signatureRef.current?.clearSignature(); };
const handleGetSignature = () => { const signatureData = signatureRef.current?.getData(); console.log(signatureData); };
return (
); };
const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', justifyContent: 'center', }, canvas: { borderWidth: 1, borderColor: '#000000', width: '90%', height: 300, // Increase the height for more drawing space }, buttonsContainer: { flexDirection: 'row', justifyContent: 'space-around', marginTop: 20, }, });