android - There is an EditText in the bottomsheetdialog. When the soft keyboard pops up, the Dialog will be pushed upward.
巴扎黑
巴扎黑 2017-07-06 10:35:13
0
1
2433

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

巴扎黑
巴扎黑

reply all (1)
巴扎黑

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.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!