This is very easy by using keyboard plugin. Please use below code in your TS file.
import { Keyboard } from ‘@ionic-native/keyboard’;
@Component({
selector: ‘page-name’,
templateUrl: ‘page.html’,
providers: [Keyboard]
})
constructor(private keyboard: Keyboard) {
/* Show keyboard */
this.keyboard.show();
/* Hide keyboard */
this.keyboard.close();
}
Note : This is only supported by Android. For iOS we can not open keyboard by this function. (Open keyboard method is not works in iOS)
import { Keyboard } from ‘@ionic-native/keyboard’;
@Component({
selector: ‘page-name’,
templateUrl: ‘page.html’,
providers: [Keyboard]
})
constructor(private keyboard: Keyboard) {
/* Show keyboard */
this.keyboard.show();
/* Hide keyboard */
this.keyboard.close();
}
Note : This is only supported by Android. For iOS we can not open keyboard by this function. (Open keyboard method is not works in iOS)
No comments:
Post a Comment