1、工具类KeyBoardPatch 下载
2、使用方法
2-1、任意新建一个Activity,在AndroidMainifest配置 android:windowSoftInputMode="stateHidden|adjustPan"
2-2、Activity布局文件中,最外层控件设置id。 android:id="@+id/content"
2-3、Activity的onCreate方法下设置
this.keyBoardPatch = new KeyBoardPatch(this, ((ViewGroup) findViewById(android.R.id.content)).getChildAt(0)); this.keyBoardPatch.enable();
Activity的onDestroy方法下设置
if (this.keyBoardPatch != null) {
this.keyBoardPatch.disable();
}