I have scaffold content with verticalArrangement = Arrangement.Bottom.
How can I make the content move upwards when the keyboard is shown, but keep the bottom bar of the scaffold in place?
I have scaffold content with verticalArrangement = Arrangement.Bottom.
How can I make the content move upwards when the keyboard is shown, but keep the bottom bar of the scaffold in place?
I coded a full minimal example to familiarize myself with the mechanics, and since I had trouble finding good information myself, I thought I might as well post the code here to maybe help others.
Starting with an empty project (
File -> New -> New project -> Empty Activity) in Android Studio, just add the lineandroid:windowSoftInputMode="adjustNothing"to the<activity>block ofAndroidManifest.xmland then replace the content ofMainActivity.ktwith the code below.Note the added
enableEdgeToEdge()inonCreatewhich might be easy to overlook.