Android的windowSoftInputMode =" adjustPan"滚动更多更多、windowSoftInputMode、Android、adjustPan

2023-09-06 07:36:29 作者:無心

考虑下面的例子为一个观点:

Consider the following example for a view:

<LinearLayout>
    <EditText />
    <Button />
</LinearLayout>

和在manifest文件:

And in in the manifest file:

android:windowSoftInputMode="adjustPan"

聚焦状态的EditText,软键盘覆盖一个按钮,像这样:

onfocus edittext, the soft keyboard covers a button like so:

但我想它是这样的:

如何滚动查看多一点,这样按钮是可见的?

How to scroll view a little more so that the button is visible?

推荐答案

我刚刚发现这个职位,看到它是无人接听。为了帮助别人谁可能会 在清单中使用的活动

I just found this post and saw it was unanswered. For the sake of helping others who may come use this in the manifest for activity

android:windowSoftInputMode="stateUnchanged|adjustResize"

尝试只有一个,看看是否适合您的需求。

try just one and see if that suits your needs.

好运气