Varying windowSoftInputMode for fragments inside the viewpager

前端 未结 1 854
执笔经年
执笔经年 2021-02-03 18:03

I have a ViewPager with 2 different fragments. For the first fragment, I would like to define it so that it does not resize upon the soft keyboard opening. For the second fragme

相关标签:
1条回答
  • 2021-02-03 18:32

    You can call on each onCreateView

    getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    

    check http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#SOFT_INPUT_ADJUST_RESIZE

    In my case, this doesn't solve the problem, because I have a transparent Fragment (a chat window) which I need to resize and the fragment on the bottom shouldn't. but I think it could be useful to you.

    0 讨论(0)
提交回复
热议问题