31

When the virtual keyboard opens, it resizes my layout. How can i made for put the keyboard on my layout? And what it doesn't re-size my layout?

Nathan Fig
  • 14,970
  • 9
  • 43
  • 57
Corentin Derbois
  • 325
  • 1
  • 3
  • 5
  • http://stackoverflow.com/questions/1512045/how-to-disable-orientation-change-in-android – Amanda S Jul 20 '11 at 17:08
  • `android:windowSoftInputMode="adjustNothing"` worked for me. It's undocumented at https://developer.android.com/guide/topics/manifest/activity-element.html#wsoft but it's mentioned in https://stackoverflow.com/questions/7020721/android-how-to-avoid-layout-being-pushed-when-keyboard-invoked/19520735. Also, Android Studio presented it to me as an option when I typed `android:windowSoftInputMode="` – Michael Osofsky Jul 31 '20 at 16:03

4 Answers4

31

You can use manifest flags to configure the effect of the virtual keyboard. See http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

Nathan Fig
  • 14,970
  • 9
  • 43
  • 57
5

Android soft keyboard resize layout

<activity android:name=".activity.SignUpActivity"
    android:screenOrientation="portrait"
    android:theme="@style/AppTheme.NoActionBar"
    android:windowSoftInputMode="adjustResize" />

It's Working for me try it.

Michael Celey
  • 12,645
  • 6
  • 57
  • 62
Ashutosh Srivastava
  • 597
  • 1
  • 9
  • 13
2
<application
    android:windowSoftInputMode="adjustResize"> 
</application>

adjustPan only resizes the input field by pushing it up just a little above the keyboard, in which case the keyboard still covers every other view beneath it.

Nick is tired
  • 6,860
  • 20
  • 39
  • 51
Emmaccen
  • 488
  • 4
  • 7
0

use only this code:

    <application
    android:windowSoftInputMode="adjustPan"
    </application>

used in manifest-application tag for all application

Omid Naji
  • 148
  • 1
  • 12
  • not working..the android:windowSoftInputMode should be on every activity like [here](https://stackoverflow.com/a/49643125/5545574) – David Antoon Mar 13 '19 at 18:32