当edittext在片段中显示键盘时移动布局

时间:2014-09-02 08:25:08

标签: android android-fragments

我有一个EditText的片段,当我显示键盘进行写入时EditText没有完全显示。

我在片段中有这个但是不起作用:

getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

有什么想法吗?

enter image description here

2 个答案:

答案 0 :(得分:3)

添加

android:windowSoftInputMode="adjustPan"

AndroidManifest.xml

您可以详细了解参数 here

答案 1 :(得分:-2)

您可以使用scrollview向上滚动以显示屏幕

相关问题