有两个方式可以实现 一:调用AppBarLayout,设置间距 val behavior = (appbar_layout.getLayoutParams() as CoordinatorLayout.LayoutParams).getBehavior() if (behavior is AppBarLayout.Behavior) { var appBarLayoutBehavior = behavior var topAndBottomOffset = appBarLayoutBehavio