Use this in your
Dialog Fragment
.
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
Inside
onCreateView
like this.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.dialog_fragment, container);
//set to adjust screen height automatically, when soft keyboard appears on screen
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
return rootView;
}
Result
β
Keyboard with button at the bottom?
Imaging that, you have a button at the bottom, when keyboard open, it will be hidden, so how to solve this problem?
Try this code
Thanks for:
Thanks for reading, please feel free to comment with this post.