У меня есть макет ограничения и внутри изображения и линейный макет. Линейный макет содержит два текстовых представления, которые я хотел бы видеть сверху и снизу ограничений линейного макета:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/chatLayout"
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="wrap_content">
<ImageView
android:id="@+id/chatPictureIV"
android:layout_width="@dimen/chat_image_size"
android:layout_height="@dimen/chat_image_size"
android:scaleType="centerInside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/chat_image_size"
android:orientation="vertical"
app:layout_constraintStart_toEndOf="@+id/chatPictureIV"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/chatNameTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Top"
android:layout_gravity="top"
android:textStyle="bold"
android:textSize="18sp" />
<TextView
android:id="@+id/chatStatusTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="Bottom"
android:textSize="18sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Однако второе текстовое представление действительно отображается под первым, но не ограничено снизу. линейного макета:
Как ограничить нижний текст нижней частью линейного макета?