我已经被困了很长一段时间了。我正在尝试开发一个聊天模块。我一直被困在这部分,当SoftInputKeyboard
覆盖RecyclerView
. 我已经尝试了几乎所有的组合和adjustResize
没有成功。adjustPan
stateHidden
stateVisible
在使用2-3 项时adjustPan
隐藏。我附上了截图。任何帮助都将不胜感激。ActionBar
recyclerview
XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/light_grey"
android:fitsSystemWindows="true"
android:focusable="true"
android:focusableInTouchMode="true">
<LinearLayout
android:id="@+id/listFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<EditText
android:id="@+id/messageInput"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/white"
android:hint="Write a message"
android:inputType="textMultiLine"
android:padding="16dp"
android:textSize="14sp" />
<ImageView
android:id="@+id/sendButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:contentDescription="@null"
android:padding="12dp"
android:src="@drawable/ic_send" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview_chat_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/listFooter"
android:layout_marginTop="8dp" />
</RelativeLayout>
- A ) 调整大小
- B ) 使用 AdjustPan