How to restore Collapsing Toolbar Layout State after screen orientation change

前端 未结 2 1309
孤独总比滥情好
孤独总比滥情好 2021-02-03 23:08

I\'ve been searching for the solution of my problem for some time and didn\'t find solution.

I want to restore my fragment\'s layout after screen orientation change. I

相关标签:
2条回答
  • 2021-02-03 23:34

    Try using the following AppBarLayout method:

    public void setExpanded (boolean expanded)
    

    However, there's an Android issue addressing the behavior you reported

    0 讨论(0)
  • 2021-02-03 23:40

    You should set ID to the CoordinatorLayout. It will automatically save its state. Believe me.

    See here.

    0 讨论(0)
提交回复
热议问题