Bottom Sheet Fragment comes up with keyboard

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

    I have faced the same scenario, Instead of EditText I used SearchView.A keyboard was not hidden when BottomSheetDialog goes to the hidden state.

    Simply call this search_channel_template.clearFocus();

    I will share my code which I was used to hiding the Keyboard.

    search_channel_template = (SearchView) bottomSheetDialog.findViewById(R.id.search_channel_template);
    
    txtVw_template_headerBS_down_id.setOnClickListener(new OnSingleClickListener() {
                @Override
                public void onSingleClick(View v) {
                    search_channel_template.clearFocus();
                    bottomSheetDialog.getBehavior().setState(BottomSheetBehaviorv2.STATE_HIDDEN);
                }
            });
    

提交回复
热议问题