From the description of CardView
CardView extends the FrameLayout class and allows you to display information inside cards that have a constant look in any application. CardView widgets can have shadows and rounded corners.
As you probably know, FrameLayout no restrictions or relationships between positioning views. They will be displayed one above the other. If you want to use a different hierarchy inside CardView , just use whatever layout you want inside. For instance:
<android.support.v7.widget.CardView android:id="@+id/card_view" android:background="@color/white" android:layout_width="200dp" android:layout_height="200dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/info_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Textview one" android:gravity="center" android:textSize="36sp" /> <TextView android:id="@+id/info_text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Textview two" android:gravity="center" android:textSize="36sp" /> </LinearLayout> </android.support.v7.widget.CardView>
Treat CardView only as an external decoration, and you can use ANY layout inside. Therefore, if LinearLayout not suitable, you can use RelativeLayout , etc.
source share