kotlin RecyclerView проблема редактирования списка - PullRequest
0 голосов
/ 27 октября 2019

Я не хочу, чтобы линии, разделяющие список контактов, подчеркивали фотографию профиля

Я поделился проблемой, и изображение, которое я пытался сделать на 2 фотографиях, которыми я поделился ниже

, естьочень простая ошибка, но я не знаю, какое решение oki появляется, мне нужна ваша помощь

ПРОБЛЕМА

введите описание изображения здесь

Я хочу сделать

введите описание изображения здесь

<?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:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    android:layout_marginTop="8dp"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:orientation="horizontal">

        <de.hdodenhof.circleimageview.CircleImageView
            android:id="@+id/imageview_latest_message"
            android:layout_width="62dp"
            android:layout_height="62dp"
            android:layout_marginStart="8dp"
            android:layout_marginLeft="24dp"
            android:layout_marginTop="4dp"
            android:layout_marginBottom="8dp"/>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="16dp"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/username_textview_latest_message"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Username"
                    android:maxLines="1"
                    android:layout_marginStart="1dp"
                    android:layout_marginLeft="16dp"
                    android:textColor="@android:color/black"
                    android:textSize="16sp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="mobile"
                    android:textAllCaps="true"
                    android:textSize="12sp" />

            </LinearLayout>

            <TextView
                android:id="@+id/message_textview_latest_message"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="1dp"
                android:layout_marginLeft="16dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="16dp"
                android:layout_marginRight="16dp"
                android:text="Latest Message"
                android:textSize="18sp" />


         </LinearLayout>
    </LinearLayout>

    <include layout="@layout/divider"/>
</LinearLayout>

1 Ответ

0 голосов
/ 27 октября 2019

Вам нужен ваш разделитель внутри вашего макета текста, а не под весь макет. Вы просто кладете разделитель 2 Layouts вверх, но я бы порекомендовал вам делать такие вещи с помощью constraintlayout, так как это было бы намного проще сделать. Код для ваших изменений находится в конце вашего XML

<TextView
            android:id="@+id/message_textview_latest_message"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="1dp"
            android:layout_marginLeft="16dp"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="16dp"
            android:layout_marginRight="16dp"
            android:text="Latest Message"
            android:textSize="18sp" />

        <include layout="@layout/divider"/>
    </LinearLayout>
</LinearLayout>


</LinearLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...