标签: xml material-design android-cardview expandable
我有CardViews,其中包含带有大量Text的TextViews,我想让它们可扩展,以便在需要时显示内容。例如:
品种1
品种2
有什么建议吗?
答案 0 :(得分:0)
您只需拥有包含不同ViewGroup的常规卡即可。当用户单击“展开/折叠”按钮时,您可以切换这些ViewGroup的可见性(VISIBLE或INVISIBLE / GONE)。
You can try to animate those changes但如果您的CardView使用了recyclelerView,那么它可能会给您带来一些问题(您可能需要更多xml中的单行内容才能使动画正常工作)。