以编程方式折叠或展开CollapsingToolbarLayout [英] Programmatically collapse or expand CollapsingToolbarLayout

查看:94
本文介绍了以编程方式折叠或展开CollapsingToolbarLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题,但我找不到答案.如何以编程方式折叠或展开CollapsingToolbarLayout?

Simple question, but I can't find an answer. How can I collapse or expand the CollapsingToolbarLayout programmatically?

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

推荐答案

使用支持库v23,您可以调用appBarLayout.setExpanded(true/false).

Using Support Library v23, you can call appBarLayout.setExpanded(true/false).

进一步阅读: AppBarLayout.setExpanded(boolean)

这篇关于以编程方式折叠或展开CollapsingToolbarLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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