nativescript-iqkeyboardmanager
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -23,2 +23,3 @@ "use strict"; | ||
var view = IQTextView.new(); | ||
this.nativeView = view; | ||
view.placeholder = this.hint; | ||
@@ -25,0 +26,0 @@ return view; |
{ | ||
"name": "nativescript-iqkeyboardmanager", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "NativeScript wrapper of the popular IQKeyboardManager iOS library", | ||
@@ -5,0 +5,0 @@ "main": "iqkeyboardmanager", |
@@ -82,2 +82,47 @@ # NativeScript IQKeyboardManager Plugin | ||
### Adding a placeholder/hint on a `TextView`'s accessory bar | ||
Looking at the gif above you may notice when focusing the Email address and password fields, | ||
the placeholder/hint of those `TextField`s is shown in the accessory bar above the keyboard. | ||
But when you use a `TextView` instead of a `TextField`, the placeholder is not shown because | ||
of an iOS limitation. You can work around this limitation by using the `TextViewWithHint` | ||
provided by this plugin. So whenever you want to use a `TextView` with a placeholder, | ||
use `TextViewWithHint` instead. | ||
#### NativeScript /w XML usage | ||
```xml | ||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:IQKeyboardManager="nativescript-iqkeyboardmanager"> | ||
<StackLayout> | ||
<TextView hint="Not working TextView hint"/> | ||
<IQKeyboardManager:TextViewWithHint hint="Working TextView hint 🤪"/> | ||
</StackLayout> | ||
</Page> | ||
``` | ||
#### NativeScript /w Angular usage | ||
In the `.modules.ts` file where you want to use this feature (or the `app.module.ts`), | ||
register the `TextViewWithHint` element: | ||
```typescript | ||
import { registerElement } from "nativescript-angular"; | ||
registerElement("TextViewWithHint", () => require("nativescript-iqkeyboardmanager").TextViewWithHint); | ||
``` | ||
Then in the view, use that element like this: | ||
```html | ||
<StackLayout> | ||
<TextView hint="Not working TextView hint"></TextView> | ||
<TextViewWithHint hint="Working TextView hint 🤪"></TextViewWithHint> | ||
</Stacklayout> | ||
``` | ||
#### NativeScript /w Vue usage | ||
Vue usage is very similar to Angular usage, the only difference is in how the element is registered. Open your app's entry file, and add this: | ||
```javascript | ||
Vue.registerElement("TextViewWithHint", () => require("nativescript-iqkeyboardmanager").TextViewWithHint) | ||
``` | ||
### Tweaking the appearance and behavior | ||
@@ -84,0 +129,0 @@ |
23380
208
202