Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 滚动视图中存在多个Recyclerview问题,添加了不必要的空间_Android_Android Recyclerview_Scrollview - Fatal编程技术网

Android 滚动视图中存在多个Recyclerview问题,添加了不必要的空间

Android 滚动视图中存在多个Recyclerview问题,添加了不必要的空间,android,android-recyclerview,scrollview,Android,Android Recyclerview,Scrollview,我正在scrollview中使用两个recyclerview。下面是我的xml代码: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width

我正在scrollview中使用两个recyclerview。下面是我的xml代码:

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView 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">

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:focusableInTouchMode="true">


        <FrameLayout
            android:id="@+id/movieTitleView"
            android:layout_width="match_parent"
            android:layout_height="120dp"
            android:background="#40C4FF">

            <TextView
                android:id="@+id/movie_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:layout_marginLeft="40dp"
                android:layout_marginTop="40dp"
                android:textColor="#FFFFFF"
                android:textSize="20sp" />

        </FrameLayout>

        <RelativeLayout
            android:id="@+id/movieSynopsisView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/movieTitleView">

            <ImageView
                android:id="@+id/movieImg"
                android:layout_width="140dp"
                android:layout_height="100dp"
                android:layout_marginLeft="3dp"
                android:layout_marginTop="6dp"
                android:src="@drawable/sample" />

            <TextView
                android:id="@+id/tvReleaseDate"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:layout_toRightOf="@+id/movieImg"
                android:text="releasedate"
                android:textSize="14sp" />

            <TextView
                android:id="@+id/vote"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/tvReleaseDate"
                android:layout_marginTop="4dp"
                android:layout_toRightOf="@+id/movieImg"
                android:text="voteavera"
                android:textSize="14sp" />

            <Button
                android:id="@+id/btnFavourite"
                android:layout_width="100dp"
                android:layout_height="53dp"
                android:layout_below="@+id/vote"
                android:layout_toRightOf="@+id/movieImg"
                android:text="@string/btn_favourite" />


            <TextView
                android:id="@+id/tvSynopsis"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/movieImg"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="10dp"
                android:text="synopsis"
                android:textSize="13sp" />

            <View
                android:id="@+id/movieDivider"
                android:layout_width="350dp"
                android:layout_height="1dp"
                android:layout_below="@+id/tvSynopsis"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="2dp"
                android:background="#000000" />


            <android.support.v7.widget.RecyclerView
                android:id="@+id/rvTrailer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/movieDivider" />


            <android.support.v7.widget.RecyclerView
                android:id="@+id/rvReview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_below="@id/rvTrailer"
                />
        </RelativeLayout>

    </RelativeLayout>
</ScrollView>

`

创建了第一个recyclerview,我可以滚动。但是有了第二次回顾 增加了一个额外的空间。我没有添加任何填充。第二个recycleview是在页面加载时在屏幕下方创建的。第一个循环视图占据整个屏幕

我错过什么了吗


有人能帮我吗?

将second RecyclerView的android:layout\u height=“match\u parent”属性替换为android:layout\u height=“wrap\u content”,如下所示:

<android.support.v7.widget.RecyclerView
    android:id="@+id/rvReview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/rvTrailer" />

我更改了包装内容的高度。这个问题仍然没有解决。Iam使用recycler视图编译'com.android.support:recyclerview-v7:25.1.1'