How to reset the Toolbar position controlled by the CoordinatorLayout?

后端 未结 8 1784
情话喂你
情话喂你 2020-12-04 16:19

The app I\'m working on consists of a Navigation Drawer which is implemented in an Activity. The activity layout is as follows:



        
8条回答
  •  情歌与酒
    2020-12-04 17:07

    Update your support lib to v23 then you can use:

    appBarLayout.setExpanded(true/false);
    

    public void setExpanded (boolean expanded)

    Sets whether this AppBarLayout is expanded or not, animating if it has already been laid out.

    As with AppBarLayout's scrolling, this method relies on this layout being a direct child of a CoordinatorLayout.

    expanded true if the layout should be fully expanded, false if it should be fully collapsed

提交回复
热议问题