AppBarLayout滑动到指定位置

作者: android01 发布时间: 2022-10-21 浏览: 1004 次 编辑

Appbarlayout 可是展示scrim,如果不想展示,可以使用方法滚动到指定位置

android.support.design.widget.CoordinatorLayout.Behavior behavior 
= ((android.support.design.widget.CoordinatorLayout.LayoutParams)appBarLayout.getLayoutParams()).getBehavior();
behavior.onNestedPreScroll(CoordinatorLayout,AppBarLayout,NestedScrollView,0,指定距离,new int[]{0,0});