@@ -13,6 +13,8 @@ const Sign = ({ text, onOK }) => {
13
13
const ref = useRef ( ) ;
14
14
const [ bg , setBg ] = useState ( bgUrl ) ;
15
15
16
+ const [ , setIsScrollEnabled ] = useState ( false ) ;
17
+
16
18
// Called after ref.current.readSignature() reads a non-empty base64 string
17
19
const handleOK = ( signature ) => {
18
20
console . log ( signature ) ;
@@ -39,33 +41,34 @@ const Sign = ({ text, onOK }) => {
39
41
console . log ( data ) ;
40
42
} ;
41
43
44
+ const signHeight = 500 ;
45
+
46
+ const height = 3 ;
47
+
48
+
49
+
42
50
return (
43
51
< SignatureScreen
44
- onLoadEnd = { ( ) => {
45
- console . log ( 'load end' )
46
- } }
52
+ onBegin = { ( ) => setIsScrollEnabled ( false ) }
53
+ bgHeight = { 100 }
54
+ trimWhitespace = { true }
55
+ scrollable = { false }
47
56
ref = { ref }
57
+ onClear = { handleClear }
58
+ onEmpty = { handleEmpty }
48
59
onEnd = { handleEnd }
49
60
onOK = { handleOK }
50
- onEmpty = { handleEmpty }
51
- onClear = { handleClear }
52
61
onGetData = { handleData }
53
- descriptionText = { text }
54
- backgroundColor = { 'transparent' }
55
- style = { { flex : 1 , height : 800 } }
56
- androidHardwareAccelerationDisabled = { false }
62
+ autoClear = { false }
63
+ style = { {
64
+ maxHeight : height * signHeight ,
65
+ overflow : "hidden" ,
66
+ } }
67
+ webviewContainerStyle = { {
68
+ maxHeight : height * signHeight ,
69
+ } }
57
70
webStyle = { `
58
- .m-signature-pad canvas {
59
- background-image: url('${ bg } ');
60
- background-size: 100% 100%;
61
- background-repeat: no-repeat;
62
- }
63
- .m-signature-pad {
64
- flex: 1;
65
- box-shadow: none;
66
- border-radius: 10px;
67
- height: 600px;
68
- }
71
+ .m-signature-pad { max-Height: ${ height } * ${ signHeight } , margin:0px !important; overflow: hidden !important; background: white !important; border: none !important; border: 2px dashed #000; } .m-signature-pad--footer {display: none !important;}
69
72
` }
70
73
/>
71
74
) ;
@@ -145,8 +148,8 @@ export default function App() {
145
148
/>
146
149
) : < Sign text = "Test" onOK = { ( img ) => {
147
150
console . log ( 'ok' )
148
- setSign ( img ) ;
149
- onCapture ( ) ;
151
+ // setSign(img);
152
+ // onCapture();
150
153
} } /> }
151
154
</ View >
152
155
{ /*</ImageBackground>*/ }
0 commit comments