Android hide Keyboard


In my Nativescript app, the application starts with the login page.
And i then ask my user to write his username and password and the keyboard is showing when the user is inputing the fields and then a user clicks “sign in”.
And the user is redirected to another Page with the Keyboard showing.
What i pretend is to the following, as soon the user redirects to another Page i pretend to disable the keyboard. so incase the keyboard moves to another screen the application doesnt crash.
Is there a way to prevent this from happening?


Before submitting the form you can execute the following on a view:


If you want to use the same code for iOS as well as Android, use this:

    // Only works against a specified field!!
    var myTextfield = page.getViewById("myTextFieldId");

    // Works on both ios and android


Hope this can help you,


<TextField #imnotf [(ngModel)]="imnumng" keyboardType="number" editable="false" (tap)="seteditableTF()" ></TextField>


let TFimno = <TextField>this.imnoTF.nativeElement;
TFimno.editable = true;