问题
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.
回答1:
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
回答2:
Add
android:windowSoftInputMode="adjustPan"
in your AndroidManifest file (in activity property)
回答3:
dialog.getWindow().
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
Its also working with out manifest file entry
来源:https://stackoverflow.com/questions/17160818/moving-edit-text-along-with-soft-keyboard-android