Activity with fragments does not resize when the keyboard opens

前端 未结 7 1586
挽巷
挽巷 2020-12-08 04:38

In my main activity there is a RelativeLayout that has 2 childs:

  • An ImageView which serves as the background
  • A LinearLa
7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-08 05:27

    Add this line of code in DialogFragment Oncreateview below R.layout.layout_ui

    getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN |     WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
    

提交回复
热议问题