显示键盘时的布局问题

时间:2011-10-27 16:16:19

标签: android layout android-layout android-ui android-gui

当隐藏软键盘时,这是我的应用程序 enter image description here 但是当显示键盘时,顶部的edittext框就消失了(它是向上推的)。 enter image description here 它看起来像这样。

我的问题是如何在键盘显示时保持两个编辑框可见?我只希望减少编辑框之间的空间......但两个框都可见

到目前为止,我的布局是这样的

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="fill_parent" android:layout_width="fill_parent"
    android:id="@+id/relativeLayout1">
    <EditText android:id="@+id/editText1" android:layout_height="wrap_content"
        android:layout_alignParentTop="true" android:layout_width="fill_parent">
        <requestFocus></requestFocus>
    </EditText>
    <EditText android:id="@+id/editText2" android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" android:layout_width="fill_parent"></EditText>
    <ImageView android:id="@+id/imageView1"
        android:layout_height="wrap_content" android:layout_below="@id/editText1"
        android:layout_above="@id/editText2" android:background="@drawable/icon"
        android:layout_width="fill_parent"></ImageView>
</RelativeLayout>

1 个答案:

答案 0 :(得分:5)

转到Android清单并从adjustPan更改“Window soft input mode”,它将整个视图移动到adjustResize,这将为您调整视图大小。

相关问题