Bottom Sheet Fragment comes up with keyboard

前端 未结 7 1752
野的像风
野的像风 2020-12-04 14:37

I have an edit text inside a bottom sheet fragment. when the focus come on the edit text the layout goes up . i tried

 android:windowSoftInputMode=\"adjustNo         


        
7条回答
  •  情深已故
    2020-12-04 15:27

    Seems like there is bug in the older design version. I encountered the same problem, but after I upgraded the design version, adjustnothing can work as expected.

    In gradle:

    com.android.support:design:26.1.0
    

    In your BottomSheetDialog:

    getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
    getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
    

提交回复
热议问题