CardView in API 10

0

With normal background:

SwitchingtoanothercolordisplaysalinebelowtheTextView:

xml:

<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#000"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    tools:context=".MainActivity">

    <android.support.v7.widget.CardView
        card_view:cardBackgroundColor="#18d018"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        card_view:cardCornerRadius="4dp">

        <LinearLayout
            android:padding="5dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:textSize="17sp"
                android:textStyle="bold"
                android:textColor="#fff"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="3"
                android:lines="1"
                android:ellipsize="end"
                android:gravity="center"
                android:text="Titulo de exemplo"/>

        </LinearLayout>

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

</RelativeLayout>
    
asked by anonymous 23.08.2015 / 07:01

1 answer

0

You need to set the divider to 0 so that it does not have that line down each cardview, this can be used both to build a list with the cards as well as individually.

    <ListView 
    android:id="@+id/android:list"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:divider="#E6E6E6"
    android:dividerHeight="0px"/>
    
24.08.2015 / 15:42