在RecyclerView翻转CardView [英] Flipping CardView in RecyclerView
问题描述
我想实现在RecyclerView一个CardView翻转。我只是想不通一个简单的解决方案。我有一个工作CardView在那里我可以显示使用回收观点卡的列表。问题是,如何显示卡的背面,如果用户点击该卡。我想使用动画和改变卡的前端到卡的背面。有人可以给一个简单的动画的卡片布局和榜样。 我现在的例子是这样的举例pretty的多副本,其中一个新的活动正在创建。凡为我所需要的卡片翻转180度,并显示其描述。是一种方法来实现呢?
+ ------------------ + ----------------- - +
| + ---------------- + | | + ---------------- + |
||前|| ||回到||
| + ---------------- + | | + ---------------- + |
| + ---------------- + | | + ---------------- + |
||前|| ||前||
| + ---------------- + | | + ---------------- + |
您可以使用的 ViewFlipper 。这是一个标准的Android窗口小部件。
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屋!