How to move the layout up when the soft keyboard is shownAndroid?

How to move the layout up when the soft keyboard is shownAndroid?

March 1, 2022·İbrahim Korucuoğlu
İbrahim Korucuoğlu

Sometimes, you need to change the layout when the soft keyboard appeared on the screen. You can fix this by adding a line of code into the AndroidManifest.xml file within the relevant activity section.

android:windowSoftInputMode="adjustResize"

Add this code to the activity.

<activity
            android:name=".MainActivity"
            android:exported="true"
            android:screenOrientation="fullSensor"
            android:theme="@style/NoActionBarTheme"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
Last updated on