File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -20,24 +20,37 @@ From your command prompt/termial go to your app's root folder and execute:
2020<Page xmlns =" http://schemas.nativescript.org/tns.xsd"
2121 xmlns : SignaturePad =" nativescript-signaturepad" >
2222 <StackLayout >
23- <SignaturePad : SignaturePad id =" drawingPad" penColor =" #3489db" penWidth =" 5" />
23+ <SignaturePad : SignaturePad
24+ height =" 200"
25+ id =" drawingPad"
26+ penColor =" #ff4081"
27+ penWidth =" 3" />
28+
29+ <button text =" Get Drawing" tap =" getDrawing" />
30+ <button text =" Clear Drawing" tap =" clearDrawing" />
2431 </StackLayout >
2532</Page >
2633```
2734
2835#### JS:
2936``` JS
3037var frame = require (" ui/frame" );
38+
39+ // To get the drawing...
3140function getDrawing (args ) {
3241 // get reference to the drawing pad
3342 var pad = frame .topmost ().currentPage .getViewById (" drawingPad" );
3443 // then access the 'drawing' property (Bitmap on Android) of the signaturepad
3544 var drawingImage = pad .drawing ;
45+ }
46+ exports .getDrawing = getDrawing;
3647
37- // If you want to clear the signature/drawing...
48+ // If you want to clear the signature/drawing...
49+ function clearDrawing (args ) {
50+ var pad = frame .topmost ().currentPage .getViewById (" drawingPad" );
3851 pad .clearDrawing ();
3952}
40- exports .getDrawing = getDrawing ;
53+ exports .clearDrawing = clearDrawing ;
4154```
4255
4356## Attributes
Original file line number Diff line number Diff line change 1212 class =" message" textWrap =" true" />
1313
1414 <SignaturePad : SignaturePad
15- height =" 270 "
15+ height =" 200 "
1616 id =" drawingPad"
1717 penColor =" #ff4081"
1818 penWidth =" 3" />
1919
2020 <Button text =" Get Drawing" tap =" getDrawing" />
2121 <button text =" Clear Drawing" tap =" clearDrawing" />
22+
2223 </StackLayout >
2324 </ScrollView >
2425</Page >
Original file line number Diff line number Diff line change 11{
22 "name" : " nativescript-signaturepad" ,
3- "version" : " 0.1.2 " ,
3+ "version" : " 0.1.3 " ,
44 "main" : " signaturepad.js" ,
55 "description" : " A NativeScript plugin to provide a way to capture signatures (and any other drawing) from the device screen." ,
66 "nativescript" : {
You can’t perform that action at this time.
0 commit comments