Bottom Sheet Fragment comes up with keyboard

前端 未结 7 1797
野的像风
野的像风 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:24

    100% working formula for BottomSheetFragment

    Use this in onCreateDialog in BottomSheetFragment

    KeyboardUtil(getActivity(), view);
    

    or

    For fragment use

    new KeyboardUtil(this, findViewById(R.id.fragment_container));
    

    by using this Util class

    https://github.com/mikepenz/MaterialDrawer/blob/aa9136fb4f5b3a80460fe5f47213985026d20c88/library/src/main/java/com/mikepenz/materialdrawer/util/KeyboardUtil.java

    Credit:Mikepenz

提交回复
热议问题