1

I am hiding the android keyboard after a user finishes typing in an edittext field. When I hide the keyboard, the entire view scrolls to the bottom. How can I avoid this scrolling?

This is what I have for hiding the keyboard:

    InputMethodManager imm = (InputMethodManager)getSystemService(
            Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(stepNameEditText.getWindowToken(), 0);
    imm.hideSoftInputFromWindow(stepDescriptionEditText.getWindowToken(), 0);
4

1 回答 1

0

您应该只需要调用hideSoftInputFromWindow()一次,并尝试使用InputMethodManager.HIDE_NOT_ALWAYS而不是“0”作为标志。

编辑:尝试添加android:windowSoftInputMode="adjustPan"到您的清单。

于 2013-09-12T19:15:20.480 回答