mardi 4 août 2015

CardView inside TableLayout

i have 2 cardviews inside a table layout. CODE:

                <TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*"
                    android:layout_height="fill_parent" android:layout_width="fill_parent"
                    android:layout_centerInParent="true"
                    android:layout_below="@+id/card_view3"
                    android:layout_marginTop="7dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="5dp">
                <TableRow android:id="@+id/TableRow01" android:layout_width="fill_parent"
                    android:layout_height="wrap_content" android:layout_weight="1">

                    <android.support.v7.widget.CardView
                        android:layout_margin="5dp" android:layout_weight="1"
                        android:layout_height="180dp" android:layout_width="fill_parent"
                        android:background="#ffdbff3d">


       </android.support.v7.widget.CardView>

     <android.support.v7.widget.CardView
          android:layout_margin="5dp" android:layout_weight="1"
               android:layout_height="180dp" android:layout_width="fill_parent"
       android:background="#ffdbff3d">


       </android.support.v7.widget.CardView>

     </TableRow>
      </TableLayout>

there is a picture inside cv1 and the problem is that when i set picture(in cv1) width to fill_parent the picture takes all the row and wont fill just the cv1 and even when i dont set fill parent its doing its job!

and i even cant set a background for my cv and i dont know why.

i hope u can solve it.

Aucun commentaire:

Enregistrer un commentaire