Reduce row space in a CardView [closed]

2

I have a problem, when implementing a Cardview. is the code of my layout:

<android.support.v7.widget.CardView
    android:id="@+id/card_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_marginBottom="@dimen/card_view_vertical"
    android:layout_marginLeft="@dimen/card_view_horizontal"
    android:layout_marginRight="@dimen/card_view_horizontal"
    android:layout_marginTop="@dimen/card_view_vertical"
    app:cardCornerRadius="@dimen/card_view_radius">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <com.android.volley.toolbox.NetworkImageView
            android:id="@+id/image"
            android:layout_width="match_parent"
            android:layout_height="176dp"
            android:adjustViewBounds="true"
            android:scaleType="centerCrop" />


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.v7.widget.Toolbar
                android:id="@+id/card_toolbar"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:background="@android:color/transparent" />

            <TextView
                android:id="@+id/title"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:ellipsize="end"
                android:gravity="center_vertical"
                android:maxLines="2"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:textSize="12sp"
                android:textStyle="bold" />

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

But at the moment of running the application this is the result:

The question is: How do I eliminate that space?

    
asked by Tuxrner 07.03.2017 в 19:39
source

1 answer

0

I did not understand what you need to remove the spaces, but if you refer to the CardView mareas just remove what he says dimensions pulls. Greetings, if it is not what you are looking for, I clarified the question or your doubt and I will gladly propose another solution.

<android.support.v7.widget.CardView
    android:id="@+id/card_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    app:cardCornerRadius="@dimen/card_view_radius">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <com.android.volley.toolbox.NetworkImageView
            android:id="@+id/image"
            android:layout_width="match_parent"
            android:layout_height="176dp"
            android:adjustViewBounds="true"
            android:scaleType="centerCrop" />


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.v7.widget.Toolbar
                android:id="@+id/card_toolbar"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:background="@android:color/transparent" />

            <TextView
                android:id="@+id/title"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:ellipsize="end"
                android:gravity="center_vertical"
                android:maxLines="2"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:textSize="12sp"
                android:textStyle="bold" />

        </RelativeLayout>
    </LinearLayout>
</android.support.v7.widget.CardView>
    
answered by 29.03.2017 в 00:13