展开和折叠CardView [英] Expand and collapse CardView

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

问题描述

扩展CardView的正确方法是什么?

What is the proper way to expand a CardView?

推荐答案

在cardview中使用可扩展列表视图

Use an expandable list view with cardview

甚至

您可以将包装内容用作卡片视图高度并使用 在标题下方的 textview 内,因此单击以使该文本视图可见反之亦然.

You can use wrap content as height of cardview and use textview inside it below title, so on click make the textview visible and vice-versa.

但是设计不好吗?

不,如果您在扩展时提供一些过渡或动画,则不是 或崩溃

nope it isn't if you give some transition or animation when it's expanded or collapsed

如果您想查看一些默认过渡,只需在父级布局中编写 android:animateLayoutChanges =" true" .

If you want to see some default transition then just write android:animateLayoutChanges="true" in parent layout.

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

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