У меня есть элемент. xml, используемый в представлении переработчика, но текст исчезает с экрана. Я пытался положиться на этот ответ ,
Вы можете избежать всего этого, задав каждому textview
ширину match_parent и соответствующий layout_weight.
но меня это смущает, так как я не уверен, где следует реализовать
width="0"
.
Мой предмет. xml:
<?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"
android:id="@+id/productLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/product_recycler_view_margin">
<ImageView
android:id="@+id/photoIV"
android:layout_width="@dimen/product_image_size"
android:layout_height="@dimen/product_image_size"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/product_image_size"
android:orientation="vertical"
android:gravity="top"
android:layout_marginStart="@dimen/product_details_margin_left"
app:layout_constraintStart_toEndOf="@+id/photoIV"
app:layout_constraintTop_toTopOf="@id/photoIV">
<TextView
android:id="@+id/titleTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Top"
android:textStyle="bold"
android:textSize="@dimen/product_details_title" />
<TextView
android:id="@+id/descriptionTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/product_details_margin_middle"
android:text="Bottom"
android:textSize="@dimen/product_details_description_text_size" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Справа есть изображение, заголовок и описание. И заголовок, и описание go за пределами экрана:
![enter image description here](https://i.stack.imgur.com/tjHPY.jpg)
Мой рециркулятор просматривает мой фрагмент, где он отображается (если это имеет значение):
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/productsRV"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>