Вырезать многострочный текст при перерисовке строки в GridView - PullRequest
0 голосов
/ 13 сентября 2018

Я разработал макет, который содержит GridView с 2 столбцами. Элементы, показанные в GridLayout, составлены из изображения и текста ниже. В первый раз макет показывает элементы правильно, но при прокрутке вверх элементы с многострочным текстом обрезаются в конце первой строки. Как я могу решить это поведение?

Это код макета:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <TextView
            android:text="Title"/>

        <GridView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:numColumns="2"
            android:orientation="vertical"
            android:dividerHeight="15dp"
            android:layout_marginStart="20dp"
            android:layout_marginEnd="20dp"
            android:layout_marginBottom="15dp"
            android:divider="@android:color/transparent"/>

    </LinearLayout>
</RelativeLayout>

А это пункт:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_margin="10dp">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="90dp"
        android:layout_gravity="center"
        android:layout_margin="15dp"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="20sp"
        android:textStyle="bold"
        android:textColor="@android:color/holo_blue_dark"
        android:fontFamily="casual"
        android:textAlignment="center"/>

</LinearLayout>
...