0

How to set custom color for a layout? Why i can't fill the color to fullscreen. There are still white space at the edges. I set the height and width to match_parent size, it still the same. screen.jpg

My code:

<RelativeLayout xmlns: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="#9a3939"
    tools:context=".Main_page">

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/cv"
        >

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

    <RelativeLayout
        android:layout_width="100dp"
        android:layout_height="160dp"
        android:padding="2dp"
        android:background="#FFF"
        android:layout_marginTop="90dp"
        android:layout_below="@+id/cv"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:id="@+id/relativeLayout">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/person_photo"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:background="@drawable/marvel"
            android:layout_above="@+id/person_name"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/person_name"
            android:textSize="15dp"
            android:autoText="false"
            android:text="Life of Pi"
            android:paddingLeft="5dp"
            android:textIsSelectable="true"
            android:textColor="#000000"
            android:layout_above="@+id/person_age"
            android:layout_alignLeft="@+id/person_photo"
            android:layout_alignStart="@+id/person_photo" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/person_age"
            android:text="Yann Martel"
            android:paddingLeft="10dp"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:textSize="10dp" />

    </RelativeLayout>

</RelativeLayout>

0 Answers0