1添加属性 WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //让布局向上移来显示软键盘 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); }
1添加属性 WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //让布局向上移来显示软键盘 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); }