打开键盘时TextView重叠按钮



当我打开键盘时,我的文本视图与按钮重叠。打开键盘时,下面的"作者信息"是重叠按钮。谁能告诉我出了什么问题?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/actionbar"
android:orientation="vertical" >
<ImageView
    android:id="@+id/imgLogo"
    android:layout_width="60dp"
    android:layout_height="60dp"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_gravity="center_horizontal"
    android:layout_marginBottom="10dp"
    android:layout_marginTop="60dp"
    android:src="@drawable/ic_launcher" />
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/imgLogo"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="15dp"
    android:text="@string/title"
    android:textColor="@color/white"
    android:textSize="13dp" />
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:gravity="center_horizontal"
    android:orientation="vertical"
    android:padding="20dp" >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginTop="15dp"
        android:text="@string/enter_name"
        android:textColor="@color/white"
        android:textSize="18dp" />
    <EditText
        android:id="@+id/username_input"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:imeActionId="@+id/login"
        android:layout_marginBottom="10dp"
        android:imeActionLabel="@string/action_sign_in_short"
        android:imeOptions="actionUnspecified"
        android:layout_marginTop="10dp"
        android:background="@color/white"
        android:inputType="textCapWords"
        android:padding="10dp" />
    <Button
        android:id="@+id/sign_in_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="40dp"
        android:background="@color/bg_btn_join"
        android:paddingLeft="25dp"
        android:paddingRight="25dp"
        android:text="@string/btn_join"
        android:textColor="@color/white" />
</LinearLayout>
<!-- author info -->
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_marginBottom="20dp"
    android:gravity="center_horizontal"
    android:orientation="vertical" >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/author_name"
        android:textColor="@color/white"
        android:textSize="12dp" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/author_url"
        android:textColor="@color/white"
        android:textSize="12dp" />
</LinearLayout>
</RelativeLayout>

请帮助我解决此问题。我不希望我的TextView重叠按钮。即使打开键盘之后,它也应该保留在其位置。

android:windowSoftInputMode="adjustPan|adjustResize"

在您的活动中,在清单设置的Windowsoftinputmode =" awadpan"中,因此活动的主窗口不调整以腾出空间,以适合软键盘。有关更多信息,请访问https://developer.android.com/guide/topics/manifest/activitive-element.html#wsoft

最新更新