0
我已经回收view.At位置0,我做了标题,并从位置1对其余项目将come.This是我的布局如何在RecyclerView android位置停止特定视图的滚动?
<android.support.design.widget.CoordinatorLayout
android:id="@+id/main_content"
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">
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="2dp">
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/recyler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="2dp"
android:background="@color/listview"
/>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout>
我想,当我滚动我的看法回收,并在半的头部向上滚动,剩余的头部在顶部粘住,其他项目的回收器视图滚动。并且在某点之后,头部的粘性部分也向上移动。如何实现它。
我会诚实地处理,如果它要需要是_that_动态再循环器视图的外报头视图;标题在概念上并不困难,但让这样一个人滑进和滑出这样的一半似乎可能是一个真正的挑战。 – zgc7009
如何处理回收站视图以外的页眉视图,以便页眉只滚动一半然后粘贴。 –
你可以尝试做一些事情,例如只是让RecyclerView正常滚动,但是检测第一个项目是否到达中间位置时,一旦它出现,就会有一个叠加视图,该视图映射出离屏幕一半的第一个项目。这会让人错觉,第一个项目已经停在顶部作为标题,实际上它正在与适配器的其余部分一起滚动。当第一个项目回到视图并处理标题视图的可见性时,请检查向下滚动。就在我的头顶,并不是说这是最好的解决方案。 – zgc7009