Move layouts up when soft keyboard is shown?
Solution 1:
Yes, check out this article on the Android developers' site which describes how the framework handles the soft keyboard appearing.
The android:windowSoftInputMode
attribute can be used to specify what happens on a per-activity basis: whether the layout is resized or whether it scrolls etc.
Solution 2:
You can also use this code in onCreate()
method:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
Solution 3:
Add in AndroidManifest.xml for your activity:
android:windowSoftInputMode="adjustPan|adjustResize"
Solution 4:
Make changes in the activity of your Manifest file like
android:windowSoftInputMode="adjustResize"
OR
Make changes in your onCreate()
method in the activity class like
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);