我的 fragment 中有一个编辑文本。为了防止软键盘将我的 View 向上推,我尝试了
android:windowSoftInputMode="adjustPan"
android:windowSoftInputMode="adjustNothing"
并以编程方式尝试了 fragment 的 onResume 和 oncreateview 方法
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
以上技术不起作用。但是当我将 scrollview 作为 fragment 中的 Root View 并放置 android:isScrollContainer="false" 属性时,上述方法就可以工作......我怎样才能让它在没有滚动的情况下工作查看
最佳答案
在 fragment 的 onCreateView() 中使用它 getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
关于android - 如何防止软键盘将我的 View 推到 fragment 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36715020/