Skip to content Skip to sidebar Skip to footer

Android - Soft Keyboard Pushes Layout Of My Activity Out Of Screen

My activity's layout is as shown below. Copy

Solution 2:

For those that are interested, the difference between android:windowSoftInputMode="adjustPan" and android:windowSoftInputMode="adjustResize" :

"adjustResize"

The activity's window is resized to make room for the soft keyboard on screen.

"adjustPan"

The contents of the activity's window are automatically panned so that the current focus is never blocked by the keyboard. This is so the user can see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.

Android Documentation

Cited link

Solution 3:

@Raj If you are working with a tabbed application you have to add

android:windowSoftInputMode="adjustPan"

on the Activity where you are adding the tabs, this would most probably be your launcher activity.

Here is a snippet from my code

<activityandroid:label="@string/app_name"android:name=".MainActivity"android:windowSoftInputMode="adjustPan"><intent-filter ><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter>

Post a Comment for "Android - Soft Keyboard Pushes Layout Of My Activity Out Of Screen"