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:
20
20
<Page xmlns =" http://schemas.nativescript.org/tns.xsd"
21
21
xmlns : SignaturePad =" nativescript-signaturepad" >
22
22
<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" />
24
31
</StackLayout >
25
32
</Page >
26
33
```
27
34
28
35
#### JS:
29
36
``` JS
30
37
var frame = require (" ui/frame" );
38
+
39
+ // To get the drawing...
31
40
function getDrawing (args ) {
32
41
// get reference to the drawing pad
33
42
var pad = frame .topmost ().currentPage .getViewById (" drawingPad" );
34
43
// then access the 'drawing' property (Bitmap on Android) of the signaturepad
35
44
var drawingImage = pad .drawing ;
45
+ }
46
+ exports .getDrawing = getDrawing;
36
47
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" );
38
51
pad .clearDrawing ();
39
52
}
40
- exports .getDrawing = getDrawing ;
53
+ exports .clearDrawing = clearDrawing ;
41
54
```
42
55
43
56
## Attributes
Original file line number Diff line number Diff line change 12
12
class =" message" textWrap =" true" />
13
13
14
14
<SignaturePad : SignaturePad
15
- height =" 270 "
15
+ height =" 200 "
16
16
id =" drawingPad"
17
17
penColor =" #ff4081"
18
18
penWidth =" 3" />
19
19
20
20
<Button text =" Get Drawing" tap =" getDrawing" />
21
21
<button text =" Clear Drawing" tap =" clearDrawing" />
22
+
22
23
</StackLayout >
23
24
</ScrollView >
24
25
</Page >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " nativescript-signaturepad" ,
3
- "version" : " 0.1.2 " ,
3
+ "version" : " 0.1.3 " ,
4
4
"main" : " signaturepad.js" ,
5
5
"description" : " A NativeScript plugin to provide a way to capture signatures (and any other drawing) from the device screen." ,
6
6
"nativescript" : {
You can’t perform that action at this time.
0 commit comments