屏幕方向更改后如何还原折叠工具栏布局状态 [英] How to restore Collapsing Toolbar Layout State after screen orientation change

查看:98
本文介绍了屏幕方向更改后如何还原折叠工具栏布局状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找问题的解决方案,但没有找到解决方案.

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 have Collapsing Toolbar Layout with banner image. After screen rotation my toolbar is always expanded, I want to restore it's behavior. How can I achieve this?

推荐答案

您应将 ID 设置为 CoordinatorLayout .它将自动保存其状态.相信我.

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

请参见此处.

这篇关于屏幕方向更改后如何还原折叠工具栏布局状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆