键盘覆盖了Android编辑文本的一半

键盘覆盖了Android编辑文本的一半,android,android-edittext,keyboard,Android,Android Edittext,Keyboard,我正在开发一个应用程序,发现键盘隐藏了EditText字段。在研究之后,我通过在清单文件中添加这行代码找到了一个解决方案 android:windowSoftInputMode="adjustPan" 但是现在我的编辑文本看起来像 表情图标、编辑文本和发送文本视图呈线性布局。如何显示键盘上方的整个线性布局 我在adjustPan上遇到了完全相同的问题,所以我改用这个 android:windowSoftInputMode="adjustResize" 我希望您的根布局是RelativeLay

我正在开发一个应用程序,发现键盘隐藏了EditText字段。在研究之后,我通过在清单文件中添加这行代码找到了一个解决方案

android:windowSoftInputMode="adjustPan"
但是现在我的编辑文本看起来像


表情图标、编辑文本和发送文本视图呈线性布局。如何显示键盘上方的整个线性布局

我在
adjustPan
上遇到了完全相同的问题,所以我改用这个

android:windowSoftInputMode="adjustResize"
我希望您的根布局是
RelativeLayout

更新

试着这样设置

chat_ui.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/chat_layout"
    android:background="@color/white">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/applayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/white"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

            <TextView
                android:id="@+id/txtTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginRight="40dp"
                android:gravity="center_horizontal"
                android:text="Francis"
                android:textColor="@color/page_background"
                android:textSize="10pt" />

        </android.support.v7.widget.Toolbar>

    </android.support.design.widget.AppBarLayout>

    <ListView
        android:layout_below="@id/applayout"
        android:id="@+id/chat_list_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/bottomlayout"
        android:layout_marginBottom="4dp"
        android:clipToPadding="false"
        android:divider="@drawable/chat_divider"
        android:paddingBottom="4dp"
        android:paddingTop="8dp"
        android:scrollbarStyle="outsideOverlay"
        android:stackFromBottom="false"
        android:transcriptMode="normal" />

    <LinearLayout
        android:id="@+id/bottomlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:orientation="horizontal">

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:layout_weight="1"
            android:background="@drawable/input"
            android:minHeight="50dp"
            android:orientation="horizontal"
            android:paddingBottom="15dp"
            android:paddingLeft="12dp"
            android:paddingRight="20dp">

            <!--  <ImageView
                  android:id="@+id/emojiButton"
                  android:layout_width="24dp"
                  android:layout_height="24dp"
                  android:layout_gravity="bottom"
                  android:src="@drawable/input_emoji" />-->

            <EditText
                android:id="@+id/chat_edit_text1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:layout_marginLeft="12dp"
                android:background="@null"
                android:hint="@string/type_message"
                android:inputType="textMultiLine"
                android:singleLine="false"
                android:textColorHint="#c4c0bd"
                android:textSize="18sp" />

        </LinearLayout>

        <ImageButton
            android:id="@+id/enter_chat1"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_gravity="bottom"
            android:background="@drawable/input_circle_normal"
            app:srcCompat="@drawable/ic_send" />

    </LinearLayout>

</RelativeLayout>

而且在舱单上

<activity
     android:name=".activities.ChatActivity"
     android:windowSoftInputMode="stateHidden|adjustResize"
     android:screenOrientation="portrait"
     android:theme="@style/MyMaterialTheme2" />


将android:softInputMode属性设置为在清单中调整大小,并将布局(而不是列表项布局)放在滚动视图中。

希望这对您有所帮助…尝试过,但没有成功:(它完全覆盖了我的编辑文本检查我的更新..它是我聊天应用程序的工作代码,在我的moto-g4 plus和牛轧糖版本中工作良好IDN对我不起作用:(感谢更新的答案,虽然抱歉,我不理解最后一部分“将布局(而非列表项布局)放入ScrollView”。我的意思是,如果您使用了listview,则不要将ScrollView放入listview的布局。您可以忽略这一点。请将ScrollView for layout放入edittext框、send按钮和所有出现的位置。