android之软件键盘

不弹出软件键盘

<activity android:name="PresCompleteActivity"
             android:windowSoftInputMode="adjustUnspecified|stateHidden"
             android:theme="@style/MyDialogStyle" />

 

设置软件键盘类型

  private InputMethodManager mInputMethodManager;

  mInputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
   ed_name = (EditText)findViewById(R.id.ed_name);
     ed_age = (EditText)findViewById(R.id.ed_age);
     ed_name.setInputType(InputType.TYPE_CLASS_TEXT);
     ed_age.setInputType(InputType.TYPE_CLASS_NUMBER);

 

关闭软件键盘

  mInputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);

android之软件键盘,布布扣,bubuko.com

android之软件键盘

上一篇:IOS设计模式之二(门面模式,装饰器模式)


下一篇:IOS设计模式之三(适配器模式,观察者模式)