2

I am using viewpager with full screen theme. but facing a problem that my softkeyboard hides the button when edittext in focus.

want to put some margin between EditText and Softkeyboard.

Tried all the things but nothing worked.

Please help me.

How to add margin between EditText and Soft Keyboard?

this is the questions link which i've asked.

Community
  • 1
  • 1
Punit
  • 667
  • 1
  • 7
  • 17

2 Answers2

0

In the activity entry in your AndroidManifest try putting:

android:windowSoftInputMode:adjustPan, this means when the keyboard comes up it will adjust the view behind it to move up so it is not obscured by the keyboard.

In the EditText you can also try adding a paddingBottom to adjust the gap between the keyboard and the bottom of the EditText.

In my case I had a custom background for the EditText, which was no longer looking OK. Because the parent view for me was ConstraintLayout I added another View element behind the EditText with:

        app:layout_constraintEnd_toEndOf="@id/view_chat_history_send_text"
        app:layout_constraintStart_toStartOf="@id/view_chat_history_send_text"
        app:layout_constraintTop_toTopOf="@id/view_chat_history_send_text"
        android:layout_marginBottom="@dimen/margin_normal"

Note: here view_chat_history_send_text is the EditText. And then I added a layout_marginBottom of the same margin as the paddingBottom of the EditText.

This means, when the EditText grows the background view grows as well, but it still maintains the gap between the keyboard and the EditText bottom.

azwethinkweiz
  • 522
  • 4
  • 8
-1

I applied above methods which worked for me was Set android:windowSoftInputMode on the Activity to "adjustPan" than I added the padding to the edittext with gravity bottom and it works like charm.

Shabbir Dhangot
  • 8,954
  • 10
  • 58
  • 80
Dhiraj Himani
  • 1,062
  • 12
  • 9
  • could you exactly tell/show what you have done? I have padding on the edittext as well, adjustPan on the activity and gravity="bottom" on the edittext as well - not working... – swalkner Dec 01 '15 at 10:08