Почему recyclerView не прокручивает этот код - PullRequest
0 голосов
/ 14 сентября 2018

У меня странная проблема в этом коде, приведенном ниже. Как видите, в нижней части кода есть реселлер (с идентификатором rv), но я столкнулся с проблемой, которая немного смутила меня, когда его layout_height равен wrap_content, он не появляется икогда это match_parent, он не прокручивается.я использую вложенный scrollview и внутри кода я положил rv rv? .isNestedScrollingEnabled = false

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    android:orientation="vertical"
    tools:context=".UI.Activities.ProviderProfileActivity">
    <include layout="@layout/app_bar" />
    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">
        <android.support.constraint.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:descendantFocusability="blocksDescendants"
            android:orientation="vertical">
            <LinearLayout
                android:id="@+id/linearLayout3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/colorPrimary"
                android:orientation="vertical"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">
                <ImageView
                    android:id="@+id/iv_user_photo"
                    android:layout_width="70dp"
                    android:layout_height="70dp"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginBottom="8dp"
                    android:background="@drawable/ic_user2"
                    android:scaleType="centerCrop" />
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:id="@+id/current_order"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="0"
                            android:textColor="@color/white" />
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="@string/current_order"
                            android:textColor="@color/white"
                            android:textSize="10sp" />
                    </LinearLayout>
                    <com.ev.phaleh.Fonts.CustomTextview
                        android:id="@+id/provider_name"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:text="الاسم"
                        android:textColor="@color/white"
                        android:visibility="invisible" />
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:id="@+id/refused_order"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="0"
                            android:textColor="@color/white" />
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="@string/refused_order"
                            android:textColor="@color/white"
                            android:textSize="10sp" />
                    </LinearLayout>
                </LinearLayout>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="4dp"
                            android:drawablePadding="5dp"
                            android:text="@string/city"
                            android:textColor="@color/white"
                            android:textSize="10sp"
                            android:visibility="gone" />
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:id="@+id/provider_address"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="4dp"
                            android:drawablePadding="5dp"
                            android:drawableStart="@drawable/loctation"
                            android:textColor="@color/white"
                            android:textSize="10sp" />
                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:layout_margin="10dp"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:orientation="vertical"
                            android:visibility="gone">
                            <com.ev.phaleh.Fonts.CustomTextview
                                android:id="@+id/pay_per_hour"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center"
                                android:text="0" />
                            <com.ev.phaleh.Fonts.CustomTextview
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center"
                                android:text="@string/current"
                                android:visibility="gone" />
                        </LinearLayout>
                    </LinearLayout>
                    <RatingBar
                        android:id="@+id/rating_bar"
                        style="?android:attr/ratingBarStyleSmall"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="8dp"
                        android:layout_marginTop="8dp"
                        android:layout_weight="1"
                        android:numStars="5"
                        android:rating="2.0"
                        android:stepSize="0.5" />
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:id="@+id/finished_order"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="0"
                            android:textColor="@color/white" />
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="@string/finished_order"
                            android:textColor="@color/white"
                            android:textSize="10sp" />
                    </LinearLayout>
                </LinearLayout>
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="4dp"
                            android:drawablePadding="5dp"
                            android:text="@string/payment"
                            android:textColor="@color/white"
                            android:textSize="10sp" />
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:id="@+id/tv_payment_way"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="4dp"
                            android:drawablePadding="5dp"
                            android:textColor="@color/white"
                            android:textSize="10sp" />
                    </LinearLayout>
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_weight="1"
                        android:gravity="center">
                        <Button
                            android:id="@+id/bt_edit_profile"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:background="@drawable/inp_style3"
                            android:gravity="center"
                            android:text="@string/edit_profile"
                            android:textColor="@color/white"
                            android:textSize="10sp" />
                    </LinearLayout>
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical">
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="4dp"
                            android:drawablePadding="5dp"
                            android:gravity="center"
                            android:text="@string/delivery"
                            android:textColor="@color/white"
                            android:textSize="10sp" />
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:id="@+id/tv_delivery"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="4dp"
                            android:drawablePadding="5dp"
                            android:gravity="center"
                            android:textColor="@color/white" />
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>
            <RelativeLayout
                android:id="@+id/relativeLayout2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/linearLayout3">
                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="50dp"
                    android:background="@color/colorPrimary" />
                <android.support.v7.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    app:cardCornerRadius="5dp"
                    app:cardElevation="4dp">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:id="@+id/about_name"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_margin="10dp"
                            android:gravity="center"
                            android:textColor="@color/black"
                            android:textStyle="bold" />
                        <ImageView
                            android:layout_width="match_parent"
                            android:layout_height="1dp"
                            android:layout_marginBottom="10dp"
                            android:layout_marginEnd="10dp"
                            android:layout_marginStart="10dp"
                            android:background="#e6e6e6" />
                        <com.ev.phaleh.Fonts.CustomTextview
                            android:id="@+id/provider_bio"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_marginEnd="10dp"
                            android:layout_marginStart="10dp"
                            android:gravity="center"
                            android:lineSpacingExtra="5dp"
                            android:textSize="12sp" />
                    </LinearLayout>
                </android.support.v7.widget.CardView>
            </RelativeLayout>
            <ImageView
                android:id="@+id/imageView2"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginEnd="8dp"
                android:layout_marginStart="8dp"
                android:background="#e6e6e6"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/relativeLayout2" />
            <com.ev.phaleh.Fonts.CustomTextview
                android:id="@+id/customTextview"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_margin="10dp"
                android:layout_marginEnd="8dp"
                android:layout_marginStart="8dp"
                android:gravity="center"
                android:text="@string/evaluations"
                android:textColor="@color/colorPrimary"
                android:textStyle="bold"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/imageView2" />
            <android.support.v7.widget.RecyclerView
                android:id="@+id/rv"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/no_evaluations">
            </android.support.v7.widget.RecyclerView>
            <android.support.v7.widget.CardView
                android:id="@+id/no_evaluations"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:layout_marginEnd="8dp"
                android:layout_marginStart="8dp"
                android:layout_marginTop="24dp"
                android:visibility="gone"
                app:cardCornerRadius="5dp"
                app:cardElevation="4dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/customTextview">
                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="20dp"
                    android:gravity="center"
                    android:text="@string/empty_evlauation"
                    android:textSize="19sp" />
            </android.support.v7.widget.CardView>
        </android.support.constraint.ConstraintLayout>
    </android.support.v4.widget.NestedScrollView>
</LinearLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...