Set focus on an input with Ionic 2
问题 SOLVED : import { Component, ViewChild} from '@angular/core'; import { Keyboard } from 'ionic-native'; @Component({ templateUrl: 'build/pages/home/home.html' }) export class HomePage { @ViewChild('input') myInput ; constructor() {} ionViewDidLoad() { setTimeout(() => { Keyboard.show() // for android this.myInput.setFocus(); },150); } } 1) import "ViewChild" import {Component, ViewChild} from '@angular/core'; 2) Create a reference to your input in your html template : <ion-input #focusInput><