layout_scrollFlags:
- scroll - 设置为可滚动。
- enterAlways - 当向下滑动时,立即显示View(比如Toolbar)。
- exitUntilCollapsed - 直至收缩到toobar的高度为止。
- enterAlwaysCollapsed - 是enterAlways的附加选项,一般跟enterAlways一起使用,它是指,View在往下“出现”的时候,首先是enterAlways效果,当View的高度达到最小高度时,View就暂时不去往下滚动,直到ScrollView滑动到顶部不再滑动时,View再继续往下滑动,直到滑到View的顶部结束。
- contentScrim - 设置当CollapsingToolbarLayout完全折叠(收缩)后的背景颜色。
expandedTitleMarginStart - 设置扩张时候(还没有收缩时)title向左填充的距离。
注意:toobar的高度要设置为
android:layout_height="?attr/actionBarSize"
否则title无法显示