How to Hide Keyboard in Ionic 3?

断了今生、忘了曾经 提交于 2019-12-11 08:59:36

问题


How to Hide Keyboard in ionic3?

We have a problem with ionic 3 apps during testing in iPhone. After fillup Payment Gateway information (which is launched in iFrame), Whenever we go to the back page using the back button, Keyboard is not Hiding.

We used cordova-plugin-ionic-keyboard and use Keyboard.hide() method. But didn't work.


回答1:


Try this

import { Keyboard } from '@ionic-native/keyboard';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
 constructor(public navCtrl: NavController, public keyboard : Keyboard) {
  }
}

and then on back button use this

this.keyboard.close()


来源:https://stackoverflow.com/questions/54553145/how-to-hide-keyboard-in-ionic-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!