0

Is it possible to have a button on the bottom of the screen and when i use the keyboard keep the button visible on the bottom and the keyboard on top of the button?

I dont need the button being pushed up with the keyboard or the keyboard going over the button.

I need the button usable and visible on the bottom of the screen and the keyboard on top of it.

  • Edittext -
  • Keyboard -
  • Button -

Thanks!

Ciro González
  • 357
  • 1
  • 4
  • 14
  • 1
    afaik no option for that, you can't enforce other app to be shown in the middle of the screen – snachmsm Feb 01 '23 at 15:06
  • 1
    The only alternative that I see is implementing a dedicated keyboard view. – bongo Feb 01 '23 at 15:08
  • Thanks for the replies. Yes, i think that the only way is with a custom keyboard view. – Ciro González Feb 01 '23 at 15:20
  • 1
    I really would not suggest doing that at all. You can write your own keyboard, but its a LOT more complicated then you think to write a good one, you'd lose 90% of the features of a good keyboard, and no Android user ever would look under the keyboard for a button, we expect the keyboard to be at the bottom. You're better off changing you design. – Gabe Sechan Feb 01 '23 at 15:41
  • Yes, i totally agree with you. I am just investigating this options to deliver an answer to my team. Thank you all! – Ciro González Feb 01 '23 at 16:03

2 Answers2

0

In Manifest.xml. Add this line android:windowSoftInputMode="adjustResize" in activity tag

<activity
    android:name=".MainActivity"
    android:exported="true"
    android:windowSoftInputMode="adjustResize">
    ...
Sohaib Ahmed
  • 1,990
  • 1
  • 5
  • 23
0

Try adding this to your Manifest.xml

        <activity
        android:name=".ui.messages.ChatActivity"
        android:fitsSystemWindows="true"
        android:windowSoftInputMode="adjustResize" />
Rajat Mittal
  • 413
  • 5
  • 19