search

Home  >  Q&A  >  body text

android - There is an EditText in the bottomsheetdialog. When the soft keyboard pops up, the Dialog will be pushed upward.

As the title shows, the Dialog will be squeezed upward, causing the interface effect to be very ugly. As shown in the picture:

I set android:windowSoftInputMode="adjustNothing" in the Activity and also set android:windowSoftInputMode="adjustNothing" in the Dialog dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING); After the keyboard pops up, it still does not work It will push the Dialog upward

I replaced bottomSheetDialog with BottomSheetFragment, and the effect was even worse, as shown below:

I hope everyone can have a good solution to share

巴扎黑巴扎黑2723 days ago2569

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-07-06 10:37:13

    What I currently think of is to customize the viewGroup as the top-level layout, and monitor the soft keyboard in onMeasure to dynamically change the height. This requires changing the windowSoftInputMode to adjustResize.

    reply
    0
  • Cancelreply