我正在制作一个用于演示目的的对话应用。在这里,我在不同的设备中获得不同的布局。不知道什么是错的。
我添加了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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context="com.caregiver.conversation.ConversationMessageView">
<View
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="5dp"
android:background="@color/colorBlack" />
<android.support.v7.widget.RecyclerView
android:id="@+id/ChatRecycl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/rlChat"
android:layout_below="@+id/view"
android:background="@color/white"
android:overScrollMode="never" />
<RelativeLayout
android:id="@+id/rlChat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/common_action_bar_splitter" />
<EditText
android:id="@+id/etTextMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="@+id/fabSend"
android:background="@drawable/round_corner_edittext_chat"
android:gravity="start"
android:hint="Type message here .. "
android:maxHeight="100dp"
android:padding="10dp" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabSend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_margin="8dp"
android:background="@color/colorAccent"
android:foregroundGravity="bottom"
android:src="@drawable/ic_send_white_anydpi"
app:fabSize="mini" />
</RelativeLayout>