У меня есть простой RecyclerView
с двумя строками. Как только второй TextView
получает несколько строк текста, он вырезается вместо того, чтобы просто увеличивать высоту представления.
![enter image description here](https://i.stack.imgur.com/3MZDy.png)
Для Например, текст, который получили два textView, был:
"Director":"Cate Shortland"
"Writer":"Jac Schaeffer (story by), Ned Benson (story by), Eric Pearson (screenplay by), Stan Lee (based on the Marvel comics by), Don Heck (based on the Marvel comics by), Don Rico (based on the Marvel comics by)"
Мое представление:
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:id="@+id/layout">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/textview"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/detial"
app:layout_constraintStart_toEndOf="@+id/detial" />
<TextView
android:id="@+id/detial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="18dp"
android:maxWidth="250dp"
android:text="@string/year"
android:maxLines="24"
android:textSize="18sp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Я попытался изменить с wrap_content
на match_parent
, добавив android:inputType="textMultiLine"
и проверил, что RecyclerView
- последняя версия (из-за некоторой ошибки, которая была в более ранних версиях). Есть идеи, что я могу попробовать?