@@ -13,25 +13,22 @@ editUrl: https://github.com/NativeScript/plugins/tree/main/packages/iqkeyboardma
1313
1414## Contents
1515
16- - [ Intro] ( #intro )
17- - [ Installation] ( #installation )
18- - [ Use @nativescript/iqkeyboardmanager ] ( #use-nativescriptiqkeyboardmanager )
19- - [ Core] ( #core )
20- - [ Angular] ( #angular )
21- - [ Vue] ( #vue )
22- - [ Svelte] ( #svelte )
23- - [ React] ( #react )
24- - [ Adding a hint text to the TextView accessory bar] ( #adding-a-hint-text-to-the-textview-accessory-bar )
25- - [ Core] ( #core-1 )
26- - [ Angular] ( #angular-1 )
27- - [ Vue] ( #vue-1 )
28- - [ Svelte] ( #svelte-1 )
29- - [ Demo app] ( #demo-apps )
30- - [ Tweaking the appearance and behavior] ( #tweaking-the-appearance-and-behavior )
31- - [ Multi-factor one-time code auto-fill] ( #multi-factor-one-time-code-auto-fill )
32- - [ Native documentation] ( #native-documentation )
33- - [ Maintainers] ( #maintainers )
34- - [ License] ( #license )
16+ - [ @nativescript/iqkeyboardmanager ] ( #nativescriptiqkeyboardmanager )
17+ - [ Contents] ( #contents )
18+ - [ Intro] ( #intro )
19+ - [ Installation] ( #installation )
20+ - [ Use @nativescript/iqkeyboardmanager ] ( #use-nativescriptiqkeyboardmanager )
21+ - [ Adding a hint text to the TextView accessory bar] ( #adding-a-hint-text-to-the-textview-accessory-bar )
22+ - [ Core] ( #core )
23+ - [ Angular] ( #angular )
24+ - [ Vue] ( #vue )
25+ - [ Svelte] ( #svelte )
26+ - [ React] ( #react )
27+ - [ Tweaking the appearance and behavior] ( #tweaking-the-appearance-and-behavior )
28+ - [ Multi-factor one-time code auto-fill] ( #multi-factor-one-time-code-auto-fill )
29+ - [ Native documentation] ( #native-documentation )
30+ - [ Maintainers] ( #maintainers )
31+ - [ License] ( #license )
3532
3633## Intro
3734
@@ -58,119 +55,20 @@ Make related text fields siblings for the IQKeyboardManager to automatically
5855:::
5956add the ` previous ` (` < ` ) and ` next ` (` > ` ) buttons to the accessory bar. The user can then use those buttons to jump back and forth.
6057
61- ### Core
62-
63- 1 . Register the plugin namespace with Page's ` xmlns ` attribute under a prefix( ` IQKeyboardManager ` for example) that you can use to access the ` PreviousNextView ` .
64-
65- ``` xml
66- <Page xmlns : IQKeyboardManager =" @nativescript-iqkeyboardmanager" >
67- ```
68-
69- 2 . Access the ` PreviousNextView ` using the prefix.
70-
71- ``` xml
72- <IQKeyboardManager : PreviousNextView ><!-- add this 'wrapper' to enable those previous / next buttons -->
73- <StackLayout >
74- <TextField hint =" Email" />
75- <TextField hint =" Password" />
76- </StackLayout >
77- </IQKeyboardManager : PreviousNextView >
78- ```
79-
80- The 2 preceding steps result in the code below:
81-
82- ``` xml
83- <Page xmlns =" http://schemas.nativescript.org/tns.xsd" xmlns : IQKeyboardManager =" @nativescript-iqkeyboardmanager" >
84- <ScrollView >
85- <IQKeyboardManager .PreviousNextView><!-- add this 'wrapper' to enable those previous / next buttons -->
86- <StackLayout >
87- <TextField hint =" Email" />
88- <TextField hint =" Password" />
89- </StackLayout >
90- </IQKeyboardManager : PreviousNextView >
91- </ScrollView >
92- </Page >
93- ```
94-
95- ### Angular
96-
97- 1 . Register the ` PreviousNextView ` element in the ` .modules.ts ` file where you want to use this feature (or the ` app.module.ts ` for global access).
98-
99- ``` ts
100- import { registerElement } from ' @nativescript/angular'
101- import { PreviousNextView } from ' @nativescript/iqkeyboardmanager'
102- registerElement (' PreviousNextView' , () => PreviousNextView )
103- ```
104-
105- 2 . Add ` PreviousNextView ` to the markup as follows:
106-
107- ``` html
108- <ScrollView >
109- <PreviousNextView
110- ><!-- add this 'wrapper' to enable those previous / next buttons -->
111- <StackLayout >
112- <TextField hint =" Email" ></TextField >
113- <TextField hint =" Password" ></TextField >
114- </StackLayout >
115- </PreviousNextView >
116- </ScrollView >
117- ```
118-
119- ### Vue
120-
121- 1 . Register ` PreviousNextView ` by adding the following code to the ` app.ts ` file.
122-
123- ``` ts
124- registerElement (
125- ' PreviousNextView' ,
126- () => require (' @nativescript/iqkeyboardmanager' ).PreviousNextView ,
127- )
128- ```
129-
130- 2 . Use ` PreviousNextView ` in markup.
131-
132- ``` xml
133- <ScrollView >
134- <PreviousNextView
135- ><!-- add this 'wrapper' to enable those previous / next buttons -->
136- <StackLayout >
137- <TextField hint =" Email" ></TextField >
138- <TextField hint =" Password" ></TextField >
139- </StackLayout >
140- </PreviousNextView >
141- </ScrollView >
142- ```
143-
144- ### Svelte
145-
146- 1 . Register ` PreviousNextView ` by adding the following code to the ` app.ts ` file.
147-
148- ``` ts
149- registerNativeViewElement (
150- ' previousNextView' ,
151- () => require (' @nativescript/iqkeyboardmanager' ).PreviousNextView ,
152- )
15358```
154-
155- 2 . Add ` previousNextView ` to markup.
156-
157- ``` xml
158- <previousNextView ><!-- add this 'wrapper' to enable those previous / next buttons -->
159- <stackLayout >
160- <textField hint =" Email" />
161- <textField hint =" Password" />
162- </stackLayout >
163- </previousNextView >
59+ IQKeyboardToolbarManager.shared.isEnabled = true
16460```
16561
166- For a demo app, visit [ NativeScript Svelte: IQ Keyboard Manager] ( https://stackblitz.com/edit/nativescript-stackblitz-templates-rygnsk?file=app/components/Home.svelte ) .
167-
16862### Adding a hint text to the TextView accessory bar
16963
17064By default, when a ` TextField ` is focused, the keyboard manager shows the field's hint label in the accessory bar above the keyboard.
17165
17266For a ` TextView ` , however, use the ` TextViewWithHint ` component,
173- provided by this plugin, to add the hint label to the accessory bar.
67+ provided by this plugin, to add the hint label to the accessory bar. Be sure to enable the toolbar:
68+
69+ ``` ts
70+ IQKeyboardToolbarManager .shared .enableAutoToolbar = true
71+ ```
17472
17573#### Core
17674
@@ -273,39 +171,32 @@ registerElement(
273171</previousNextView >
274172```
275173
276- ### Demo apps
277-
278- The following are links to the plugin demo apps in the different JS flavors.
279-
280- - [ NativeScript TS: IQ Keyboard Manager] ( https://stackblitz.com/edit/nativescript-stackblitz-templates-sia8th?file=app/main-page.xml ) .
281- - [ NativeScript Svelte: IQ Keyboard Manager] ( https://stackblitz.com/edit/nativescript-stackblitz-templates-rygnsk?file=app/components/Home.svelte )
282- - [ NativeScript React: IQ Keyboard Manager] ( https://stackblitz.com/edit/nativescript-stackblitz-templates-5uygfj?file=src/components/ScreenOne.tsx )
283-
284174### Tweaking the appearance and behavior
285175
286- To tweak the appearance and behavior of ` PreviousNextView ` , follow the steps below:
287-
2881761 . Add the following path to your app’s ` references.d.ts ` file.
289177
290178``` xml
291- /// <reference path =" ./node_modules/@nativescript/iqkeyboardmanager/index.d.ts" />
179+ /// <reference path =" ./node_modules/@nativescript/iqkeyboardmanager/typings/ index.d.ts" />
292180```
293181
2941822 . Initialize an instance of ` IQKeyboardManager ` as follows.
295183
296184``` typescript
297- const iqKeyboard = IQKeyboardManager .sharedManager ()
185+ const iqKeyboard = IQKeyboardManager .shared
298186```
299187
300188You now have the full IQKeyboardManager APIs available for you to use. For example, to switch to a dark keyboard you could use the following code.
301189
302190``` typescript
303- const iqKeyboard = IQKeyboardManager .sharedManager ()
304- iqKeyboard .overrideKeyboardAppearance = true
305- iqKeyboard .keyboardAppearance = UIKeyboardAppearance .Dark
306- ```
191+ const iqKeyboard = IQKeyboardManager .shared
192+ const config = IQKeyboardAppearanceConfiguration .new ()
193+ config .appearance = UIKeyboardAppearance .Dark
194+ config .overrideAppearance = true
195+ iqKeyboard .keyboardConfiguration = config
307196
308- <img src =" https://github.com/tjvantoll/nativescript-IQKeyboardManager/raw/master/demo.gif " width =" 320px " />
197+ // Toolbar
198+ iqKeyboard .enableAutoToolbar = true
199+ ```
309200
310201#### Multi-factor one-time code auto-fill
311202
0 commit comments