Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
15747 anikendra 1
Keyboard
2
======
3
 
4
The `cordova.plugins.Keyboard` object provides functions to make interacting with the keyboard easier, and fires events to indicate that the keyboard will hide/show.
5
 
6
    cordova plugin add com.ionic.keyboard
7
 
8
Methods
9
-------
10
 
11
- cordova.plugins.Keyboard.hideKeyboardAccessoryBar
12
- cordova.plugins.Keyboard.close
13
- cordova.plugins.Keyboard.disableScroll
14
- cordova.plugins.Keyboard.show
15
 
16
Properties
17
--------
18
 
19
- cordova.plugins.Keyboard.isVisible
20
 
21
Events
22
--------
23
 
24
These events are fired on the window.
25
 
26
- native.keyboardshow
27
  * A number `keyboardHeight` is given on the event object, which is the pixel height of the keyboard.
28
- native.keyboardhide
29
 
30
Keyboard.hideKeyboardAccessoryBar
31
=================
32
 
33
Hide the keyboard accessory bar with the next, previous and done buttons.
34
 
35
    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
36
    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
37
 
38
Supported Platforms
39
-------------------
40
 
41
- iOS
42
 
43
 
44
Keyboard.close
45
=================
46
 
47
Close the keyboard if it is open.
48
 
49
    cordova.plugins.Keyboard.close();
50
 
51
Supported Platforms
52
-------------------
53
 
54
- iOS, Android, Blackberry 10
55
 
56
 
57
Keyboard.disableScroll
58
=================
59
 
60
Disable native scrolling, useful if you are using JavaScript to scroll
61
 
62
    cordova.plugins.Keyboard.disableScroll(true);
63
    cordova.plugins.Keyboard.disableScroll(false);
64
 
65
Supported Platforms
66
-------------------
67
 
68
- iOS
69
 
70
Keyboard.show
71
=================
72
 
73
Force keyboard to be shown on Android. This typically helps if autofocus on a text element does not pop up the keyboard automatically
74
 
75
    cordova.plugins.Keyboard.show();
76
 
77
Supported Platforms
78
 
79
- Android, Blackberry 10
80
 
81
native.keyboardshow
82
=================
83
 
84
This event fires when the keyboard will be shown
85
 
86
    window.addEventListener('native.keyboardshow', keyboardShowHandler);
87
 
88
    function keyboardShowHandler(e){
89
        alert('Keyboard height is: ' + e.keyboardHeight);
90
    }
91
 
92
Properties
93
-----------
94
 
95
keyboardHeight: the height of the keyboard in pixels
96
 
97
 
98
Supported Platforms
99
-------------------
100
 
101
- iOS, Android, Blackberry 10
102
 
103
 
104
native.keyboardhide
105
=================
106
 
107
This event fires when the keyboard will hide
108
 
109
    window.addEventListener('native.keyboardhide', keyboardHideHandler);
110
 
111
    function keyboardHideHandler(e){
112
        alert('Goodnight, sweet prince');
113
    }
114
 
115
Properties
116
-----------
117
 
118
None
119
 
120
Supported Platforms
121
-------------------
122
 
123
- iOS, Android, Blackberry 10