android:layout_width=“50dp”
android:layout_height=“50dp”
android:src="@drawable/shu" />
<TextView
android:id="@+id/left_name"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“12dp”
android:text=“小洛”
android:textSize=“16sp” />
<TextView
android:layout_marginLeft=“10dp”
android:background="@drawable/shuborder"
android:gravity=“center”
android:textSize=“16sp”
android:layout_gravity=“center_vertical”
android:id="@+id/left_message"
android:layout_width=“200dp”
android:layout_height=“50dp”>
![在这里插入图片描述](https://img-blog.csdnimg.cn/20190531132137720.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0
《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整内容开源分享
L3FxXzQwNjYwMzM5,size_16,color_FFFFFF,t_70)
- 右边布局的实现(客户端发送和接收消息),用户的头像、名字和对话框以及时间戳的布局
<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
android:orientation=“vertical” >
<TextView
android:id="@+id/right_time"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_gravity=“center”
android:background="#f5f5f5"
android:paddingTop=“5dp”
android:textSize=“14sp” />
<LinearLayout
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:gravity=“right”
android:orientation=“horizontal” >
<TextView
android:id="@+id/right_message"
android:layout_width=“200dp”
android:layout_height=“50dp”
android:layout_gravity=“center_vertical”
android:layout_marginRight=“10dp”
android:background="@drawable/myborder"
android:gravity=“center”
android:textSize=“16sp” />
<LinearLayout
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:orientation=“vertical” >
<ImageView
android:id="@+id/right_image"
android:layout_width=“50dp”
android:layout_height=“50dp”
android:src="@drawable/my" />
<TextView
android:id="