在RecyclerView翻转CardView [英] Flipping CardView in RecyclerView

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

问题描述

我想实现在RecyclerView一个CardView翻转。我只是想不通一个简单的解决方案。我有一个工作CardView在那里我可以显示使用回收观点卡的列表。问题是,如何显示卡的背面,如果用户点击该卡。我想使用动画和改变卡的前端到卡的背面。有人可以给一个简单的动画的卡片布局和榜样。 我现在的例子是这样的举例pretty的多副本,其中一个新的活动正在创建。凡为我所需要的卡片翻转180度,并显示其描述。是一种方法来实现呢?

  + ------------------ + ----------------- -  +
| + ---------------- + | | + ---------------- + |
||前|| ||回到||
| + ---------------- + | | + ---------------- + |
| + ---------------- + | | + ---------------- + |
||前|| ||前||
| + ---------------- + | | + ---------------- + |
 

解决方案

您可以使用的 ViewFlipper 。这是一个标准的Andr​​oid窗口小部件。

I am trying to implement a CardView flip in a RecyclerView. I just cannot figure out a simple solution. I have a working CardView where i can display a list of card using the recycler view. The problem is, how to show the back of the card if user click the card. I want to use animation and change the front of the card to the back of the card. Can someone give a simple animation and example of the card layout. My current example is pretty much copy of this example where a new activity is being created. Where as i need the card to flip 180 degree and show the description. Is the a way to achieve it?

+------------------+ +------------------+
|+----------------+| |+----------------+|
||  front         || ||  back          ||
|+----------------+| |+----------------+|
|+----------------+| |+----------------+|
||  front         || ||  front         ||
|+----------------+| |+----------------+|

解决方案

You could use a ViewFlipper. It's a standard Android widget.

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

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