mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #3757 from NativeScript/fix-android-keyboard
FIX: Android keyboard
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
export function onButtonLoaded(args){
|
||||
if (args.object.android){
|
||||
import { ad } from "utils//utils";
|
||||
import { isAndroid } from "platform";
|
||||
|
||||
export function onButtonLoaded(args) {
|
||||
if (args.object.android) {
|
||||
args.object.android.setFocusableInTouchMode(true);
|
||||
args.object.android.setFocusable(true);
|
||||
args.object.android.setClickable(true);
|
||||
}
|
||||
}
|
||||
|
||||
export function onListViewLoaded(args){
|
||||
export function onListViewLoaded(args) {
|
||||
args.object.items = [1];
|
||||
}
|
||||
|
||||
export function hideKeyboard() {
|
||||
if (isAndroid) {
|
||||
ad.dismissSoftInput();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
<StackLayout>
|
||||
<Button height="100" width="100" loaded="onButtonLoaded" text="Click me 3rd (Android)" style.fontSize="8"/>
|
||||
<Button height="50" width="100" text="hide keyboard" onTap="hideKeyboard" style.fontSize="8"/>
|
||||
<Button height="50" width="100" loaded="onButtonLoaded" text="Click me 3rd (Android)" style.fontSize="8"/>
|
||||
<ListView loaded="onListViewLoaded">
|
||||
<ListView.itemTemplate>
|
||||
<StackLayout>
|
||||
|
||||
Reference in New Issue
Block a user