聚焦离子输入时有什么方法可以隐藏键盘吗? [英] Is there any way to hide keyboard when focusing an ion-input?
本文介绍了聚焦离子输入时有什么方法可以隐藏键盘吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要一个离子输入,它会被聚焦并且不应该出现键盘.有什么办法或者有可能吗?谢谢!
I wanted to have an ion-input that will be focused and the keyboard should not appear. Is there any way or is it possible? Thank you!
推荐答案
是的,安装这个插件 -> https://ionicframework.com/docs/native/keyboard/
yes, install this plugin -> https://ionicframework.com/docs/native/keyboard/
html
<ion-input type="text" [(ngModel)]="message" (ionFocus)="keyboard_show()" #input ></ion-input>
ts
import {
Keyboard
} from '@ionic-native/keyboard';
constructor(private keyboard: Keyboard, private ) {
}
keyboard_show(){
this.keyboard.close();
}
这篇关于聚焦离子输入时有什么方法可以隐藏键盘吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文