Appbarlayout is actually a linearlayout, but the Design support library does a lot of scrolling events for it,
Nest toolbar into appbarlayout and assign a layout behavior to the control that displays the subject content of the page
<Android.support.design.widget.AppBarLayoutAndroid:layout_width= "Match_parent"Android:layout_height= "Wrap_content"> <Android.support.v7.widget.ToolbarAndroid:id= "@+id/toolbar"Android:layout_width= "Match_parent"Android:layout_height= "? Attr/actionbarsize"Android:background= "? Attr/colorprimary"Android:popuptheme= "@style/themeoverlay.appcompat.light"Android:theme= "@style/themeoverlay.appcompat.dark.actionbar"
Scroll indicates that when the content is scrolled toobar will scroll up and hide,
Enteralways indicates that when the content country scrolls, the toolbar will scroll and display in the countryside.
Snap means that when the content is not completely hidden or displayed, the hidden or displayed app:layout_scrollflags are automatically selected based on the distance currently scrolled= "Scroll|enteralways|snap" /><!--Toobar Add this property in Appbarlayout toolbar will be hidden with the content of the theme, the next row appears - </Android.support.design.widget.AppBarLayout>
Specify layout behavior
App:layout_behavior= "@string/appbar_scrolling_view_behavior"
Don't forget to add design support dependencies
More advanced toolbar Use the----appbarlayout