I have a RecyclerView for displaying a list of items. There is this android CardView class given by android to show card layout.
If I use a RelativeLayout and set its background to white it works the same way. Also in case of CardView I have to anyway add a childlayout to it which basically contains the all the views inside the card.
So I wanted to know if their is any benefit of using a CardView (which actually increases the hierarchy of the views) rather than a normal Layout directly.
Android – Why use a CardView instead of a RelativeLayout or LinearLayout
androidandroid-cardviewandroid-layoutandroid-recyclerview
Best Answer
There are some advantages of cards over layouts, including:
All these and other features can be found in the card's design guideline.
In short: