Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/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不会更新CoordinatorLayout,而触摸滚动则会更新CoordinatorLayout_Android_Android Appcompat - Fatal编程技术网

Android 手动滚动RecyclerView不会更新CoordinatorLayout,而触摸滚动则会更新CoordinatorLayout

Android 手动滚动RecyclerView不会更新CoordinatorLayout,而触摸滚动则会更新CoordinatorLayout,android,android-appcompat,Android,Android Appcompat,recyclerview滚动工具栏没有您可以放置的 LinearLayoutManager layoutManager = ((LinearLayoutManager) getLayoutManager()); layoutManager.scrollToPositionWithOffset(spanCount * exactItemPos / mScrollPosState.rowHeight, -(exactItemPos % mScrollP

recyclerview滚动工具栏没有您可以放置的

LinearLayoutManager layoutManager = ((LinearLayoutManager) getLayoutManager());
        layoutManager.scrollToPositionWithOffset(spanCount * exactItemPos / mScrollPosState.rowHeight,
                -(exactItemPos % mScrollPosState.rowHeight));
在使用偏移量滚动地形位置之前,您可以

LinearLayoutManager layoutManager = ((LinearLayoutManager) getLayoutManager());
        layoutManager.scrollToPositionWithOffset(spanCount * exactItemPos / mScrollPosState.rowHeight,
                -(exactItemPos % mScrollPosState.rowHeight));

在执行带有偏移量的scrollToPositionWithOffset之前,CoordinatorLayout.Behavior仅适用于NestedScroll事件。当您尝试以编程方式滚动RecyclerView时,它被视为正常滚动

在行下方写入通知RecyclerView start NesteadScroll,使用ViewCompat。滚动轴\u垂直ViewCompat。键入\u非触摸

ViewCompat.SCROLL\u AXIS\u VERTICAL:表示沿垂直轴滚动。 ViewCompat.TYPE\u NON\u TOUCH:表示手势的输入类型是由非用户触摸屏幕引起的。这通常来自于一次正在平息的狂欢

    appBarLayout.setExpanded(false);

CoordinatorLayout.行为仅适用于NestedScroll事件。当您尝试以编程方式滚动RecyclerView时,它被视为正常滚动

在行下方写入通知RecyclerView start NesteadScroll,使用ViewCompat。滚动轴\u垂直ViewCompat。键入\u非触摸

ViewCompat.SCROLL\u AXIS\u VERTICAL:表示沿垂直轴滚动。 ViewCompat.TYPE\u NON\u TOUCH:表示手势的输入类型是由非用户触摸屏幕引起的。这通常来自于一次正在平息的狂欢

    appBarLayout.setExpanded(false);

我希望scrollToPositionWithOffset更改AppBarLayout,就像用户正在滚动一样,明白我的意思吗?我希望scrollToPositionWithOffset更改AppBarLayout,就像用户正在滚动一样,明白我的意思吗?