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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -