在使用 android:windowSoftInputMode="adjustPan" 和getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);还不起作用时,
看一下SearchView是否添加
android:imeOptions="flagNoExtractUi"
<activity android:name="com.shangdatong.cash.view.activty.MainActivity"
android:windowSoftInputMode="adjustPan"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
.....
}