Android 手动滚动RecyclerView不会更新CoordinatorLayout,而触摸滚动则会更新CoordinatorLayout
recyclerview滚动工具栏没有您可以放置的Android 手动滚动RecyclerView不会更新CoordinatorLayout,而触摸滚动则会更新CoordinatorLayout,android,android-appcompat,Android,Android Appcompat,recyclerview滚动工具栏没有您可以放置的 LinearLayoutManager layoutManager = ((LinearLayoutManager) getLayoutManager()); layoutManager.scrollToPositionWithOffset(spanCount * exactItemPos / mScrollPosState.rowHeight, -(exactItemPos % mScrollP
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,就像用户正在滚动一样,明白我的意思吗?