Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android WindowsOfInputMode=";“调整盘”;再滚动一些_Android_Android Layout_Android View_Android Xml - Fatal编程技术网

Android WindowsOfInputMode=";“调整盘”;再滚动一些

Android WindowsOfInputMode=";“调整盘”;再滚动一些,android,android-layout,android-view,android-xml,Android,Android Layout,Android View,Android Xml,考虑以下视图示例: <LinearLayout> <EditText /> <Button /> </LinearLayout> 在Focus edittext上,软键盘覆盖一个按钮,如下所示: 但我喜欢这样: 如何将视图再滚动一点,使按钮可见?能否在按钮下方添加一个空的RelativeLayout。 设置其android:layout\u height=“50dp”或满足您需要的任何值。 使用ScrollView,请注意Sc

考虑以下视图示例:

<LinearLayout>
    <EditText />
    <Button />
</LinearLayout>
在Focus edittext上,软键盘覆盖一个按钮,如下所示:

但我喜欢这样:


如何将视图再滚动一点,使按钮可见?

能否在按钮下方添加一个空的RelativeLayout。 设置其android:layout\u height=“50dp”或满足您需要的任何值。 使用ScrollView,请注意ScrollView只能有一个子布局

<ScrollView >
  <LinearLayout>
    <EditText />
    <Button />
    <RelativeLayout 
      android:layout_height="50dp"
      android:layout_width="match_parent" />
  </LinearLayout>
</ScrollView>

我刚找到这篇文章,发现没有人回复。为了帮助可能来的人 在活动清单中使用此选项

android:windowSoftInputMode="stateUnchanged|adjustResize"
试一个,看看是否适合你的需要


祝你好运,请给出答案:只需使用
adjustResize
属性
adjustResize
可能会在较小的屏幕中弄乱您的布局。在找到此帖子之前,我必须为WindowsofInputMode尝试了30种不同的组合。谢谢。“stateUnchanged | adjustResize”将调整窗口大小,并尝试将当前焦点项目保持在屏幕上。它不会尽力将按钮保留在屏幕上。@DotProductSoft清单的哪个部分应该是属性?抱歉。今天才注意到你的问题。您可能已经找到了答案,但希望其他人可以使用此信息。将它作为您正在呈现的标记的属性放入清单中。如何动态地重新创建它。我知道:getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT\u INPUT\u ADJUST\u PAN);但是你怎么说呢?
android:windowSoftInputMode="stateUnchanged|adjustResize"