java - How create several columns of CardViews -
i try create fragment several columns of cardviews
:
<linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="3dp" android:orientation="horizontal" > <android.support.v7.widget.cardview android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" app:cardelevation="2dp" app:cardcornerradius="3dp"> <textview android:text = "column 1" android:layout_width = "wrap_content" android:layout_height = "wrap_content" /> </android.support.v7.widget.cardview> <android.support.v7.widget.cardview android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" app:cardelevation="2dp" app:cardcornerradius="3dp"> <textview android:text = "column 2" android:layout_width = "wrap_content" android:layout_height = "wrap_content" /> </android.support.v7.widget.cardview> </linearlayout>
but see first cardview
on full width. second cardviews
not shown.
what wrong?
set android:layout_weight="1"
in both cardviews
Comments
Post a Comment