<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content" android:padding="12dp"> <View android:id="@+id/iv_left" android:layout_width="36dp" android:layout_height="36dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" /> <androidx.cardview.widget.CardView android:id="@+id/cv_header" android:layout_width="36dp" android:layout_height="36dp" android:elevation="0dp" app:cardCornerRadius="18dp" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent"> <ImageView android:id="@+id/iv_header" android:layout_width="36dp" android:layout_height="36dp" android:layout_centerVertical="true" android:src="@drawable/platform_head_place_hold_pic" /> </androidx.cardview.widget.CardView> <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" android:gravity="right" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:orientation="vertical" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintHorizontal_weight="1" app:layout_constraintLeft_toRightOf="@id/iv_left" app:layout_constraintRight_toLeftOf="@id/cv_header" app:layout_constraintTop_toTopOf="parent"> <TextView android:id="@+id/tv_right_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/im_question_message_round_1da1f2_8dp_bg" android:textColor="@color/white" android:textSize="@dimen/im_text_size_17" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toLeftOf="@id/cv_header" app:layout_constraintTop_toTopOf="parent" tools:text="你好,为了更好的。你好,为了更好的。你好,为了更好的。你好,为了更好的。你好,为了更好的。你好,为了更好的。" /> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>