moving edit text along with soft keyboard android

5.3k Views Asked by At

I am having an comment edit text in my application. The edit text is aligned at the bottom of the screen. when edit text is focused i want to move edit text alone with soft keyboard without changing other views in layout similar to comment edit box in facebook. I tried adjustpan in manifest but it moves all views up with soft keyboard. adjustresize in manifest hides some view.please provide suggestions.

3

There are 3 best solutions below

0
On

Add

android:windowSoftInputMode="adjustPan"

in your AndroidManifest file (in activity property)

2
On

Try like this inside your Android manifest file..

<activity name="YourActivity"
    android:windowSoftInputMode="stateVisible|adjustResize">
</activity>

or

<activity name="YourActivity"
    android:windowSoftInputMode="stateVisible|adjustPan">
</activity>

Please also read this for ref/Clarity

0
On

dialog.getWindow(). setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

Its also working with out manifest file entry