0

我在nestedscrollview 中有三个recyclerview,我需要第三个继续回收,就像他不在nestedscrollview 中一样。除了缺少回收功能外,一切都很好。

这是我的 xml:

        <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/scroll_discovery"
        android:fillViewport="true"
        android:fitsSystemWindows="true"
        >
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            >
            <android.support.v7.widget.RecyclerView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/category_recycler"/>
            <android.support.v7.widget.RecyclerView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/category_recycler"
                android:id="@+id/user_recycler"/>
            <android.support.v7.widget.RecyclerView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/user_recycler"
                android:id="@+id/experiences"/>
        </RelativeLayout>
    </android.support.v4.widget.NestedScrollView>

这是java部分

experienceRecycler=(RecyclerView)findViewById(R.id.experiences);
    experienceRecycler.setHasFixedSize(true);
    mLayoutManager =new LinearLayoutManager(this) {
        @Override
        public boolean canScrollVertically() {
            return false;
        }
    };
    page= 1;
    experienceRecycler.setLayoutManager(mLayoutManager);
    experienceAdapter=new FeedCardAdapter(experiences,this,currentUser);
    experienceRecycler.setAdapter(experienceAdapter);
    /*experienceRecycler.addOnScrollListener(new RecyclerView.OnScrollListener() {
        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
            super.onScrollStateChanged(recyclerView, newState);
        }

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            feedCardAdapter.setScrolled(true);
        }
    });*/

    categoryRecycler=(RecyclerView)findViewById(R.id.category_recycler);
    categoryRecycler.setLayoutManager(new LinearLayoutManager(this){
        @Override
        public boolean canScrollVertically() {
            return false;
        }
    });
    categoryAdapter=new CategoryAdapter(this,categories);
    categoryRecycler.setHasFixedSize(true);
    categoryRecycler.setAdapter(categoryAdapter);

    userRecycler=(RecyclerView)findViewById(R.id.user_recycler);

    userRecycler.setLayoutManager(new LinearLayoutManager(this){
        @Override
        public boolean canScrollVertically() {
            return false;
        }
    });
    userAdapter=new UserAdapter(this,users);
    userRecycler.setAdapter(userAdapter);
    userRecycler.setHasFixedSize(true);
4

1 回答 1

0

我终于自己找到了解决方案。我刚刚达到了我想继续回收的回收站的高度。

于 2016-05-23T14:21:41.047 回答