Представление выше повторяется - PullRequest
0 голосов
/ 15 февраля 2020

У меня CardView выше RecycleView, но при загрузке Page RecyclerView вверху и CardView пропускается. Почему это может случиться?

Похоже, ваш пост в основном кодовый; пожалуйста, добавьте еще некоторые детали. Похоже, ваш пост в основном кодовый; пожалуйста, добавьте еще некоторые детали. Похоже, ваш пост в основном кодовый; пожалуйста, добавьте еще некоторые детали. Похоже, ваш пост в основном кодовый; пожалуйста, добавьте больше деталей.

<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ProgressBar
            android:id="@+id/homeProgress"
            android:layout_width="100dp"
            android:layout_height="100dp"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            android:progressTint="@color/colorText"
            android:visibility="visible"/>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/homeMainLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/colorBackground"
            android:padding="10dp"
            android:visibility="gone">

            <androidx.cardview.widget.CardView
                android:id="@+id/firstPlace"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:backgroundTint="@color/colorCardView"
                app:cardCornerRadius="10dp"
                android:padding="10dp"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal">


                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:padding="10dp">

                        <TextView
                            android:id="@+id/firstPlaceName"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textSize="30sp"
                            android:textColor="@color/colorText"/>

                        <TextView
                            android:id="@+id/firstPlaceCount"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textSize="15sp"
                            android:textColor="@color/colorText"/>

                    </LinearLayout>

                    <ImageView
                        android:id="@+id/firstPlaceImage"
                        android:layout_width="100dp"
                        android:layout_height="100dp"
                        android:layout_alignParentEnd="true"/>


                </RelativeLayout>
            </androidx.cardview.widget.CardView>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/artistsWithImagesRecycler"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintTop_toBottomOf="@+id/firstPlace"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                android:overScrollMode="never"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager">

            </androidx.recyclerview.widget.RecyclerView>

        </androidx.constraintlayout.widget.ConstraintLayout>


    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

Ответы [ 3 ]

1 голос
/ 16 февраля 2020

выровняйте вид Recyler сверху вниз по виду карты

0 голосов
/ 16 февраля 2020

Добавьте вес к просмотру карты и представлению переработчика или измените расположение ограничений на относительное расположение, удалите нижние строки в представлении переработчика

app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent

0 голосов
/ 15 февраля 2020

Вы установили ConstraintLayout с идентификатором homeMainLayout как пропавший. Удалите атрибут android: видимость = "ушел" из него, и представление карты будет отображаться так, как вы ожидаете.

...