仅在键入android时更改editText的位置

仅在键入android时更改editText的位置,android,Android,当我在我的应用程序中,我想键入弹出的键盘,但应用程序中的所有元素也会启动。我想知道我如何才能使editText和它的按钮上升,让其他元素保持它们的位置。这是我的代码(刚开始编码): 对于我来说,添加 android:windowSoftInputMode=“adjustResize”在清单中为我添加 android:windowSoftInputMode=“adjustResize”的清单中显示您的代码。好的,我做到了!您可以尝试在清单文件的标记中添加android:WindowsOfInpu

当我在我的应用程序中,我想键入弹出的键盘,但应用程序中的所有元素也会启动。我想知道我如何才能使editText和它的按钮上升,让其他元素保持它们的位置。这是我的代码(刚开始编码):


对于我来说,添加
android:windowSoftInputMode=“adjustResize”
在清单中为我添加
android:windowSoftInputMode=“adjustResize”
的清单中显示您的代码。好的,我做到了!您可以尝试在清单文件的标记中添加android:WindowsOfInputMode=“adjustPan”这个属性吗?显示您的代码。好的,我做到了!您可以尝试在清单文件的标记中添加android:WindowsOfInputMode=“adjustPan”此属性吗?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.jochem.chatbot.MainActivity"
    android:background="#ffffff">

    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imageButton"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:src="@mipmap/ic_launcher"
        android:background="#00ffffff"
        android:onClick="changeText" />

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/editText"
        android:layout_alignBottom="@+id/imageButton"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_toLeftOf="@+id/imageButton"
        android:layout_toStartOf="@+id/imageButton"
        android:textSize="20dp"
        android:textColor="#000000"
        android:hint="Yeah, typ something"
        android:textColorHint="#505050"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Typ something"
        android:id="@+id/textView"
        android:layout_alignParentTop="true"
        android:layout_alignLeft="@+id/editText"
        android:layout_alignStart="@+id/editText"
        android:layout_alignRight="@+id/imageButton"
        android:layout_alignEnd="@+id/imageButton"
        android:textColor="#000000"
        android:textSize="25dp" />

</RelativeLayout>