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?
Asked
Active
Viewed 6.2k times
31
-
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 Answers
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
-
2you use which option to prevent the keyboard from affecting the layout ? – Dimitri May 27 '13 at 10:51
-
8"adjustPan" - Read the API description of that and adjustResize in the link I posted. – Nathan Fig May 28 '13 at 14:05
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