Space between image and content Android studio

0

I'm developing a mobile application using android studio 2.2.2 and wanted to leave my application with that look.

ButIcannot,byputtingtheimageitgetsaspacebetweentheimageandtheTextViewfromaboveandbelow.

<?xmlversion="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.tulio.exercicio3.MainActivity">


<TextView
    android:id="@+id/Lamborghini"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@android:color/holo_green_dark"
    android:text="Lamborghini"
    android:textAlignment="center"
    android:textColor="#ffffff"
    android:textSize="50sp" />

<ImageView
    android:id="@+id/imageView"
    android:layout_width="match_parent"
    android:layout_height="272dp"
    android:layout_weight="3"
    app:srcCompat="@drawable/lamborghini" />


<TextView
    android:id="@+id/aventador"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@android:color/darker_gray"
    android:text="Aventador"
    android:textAlignment="center"
    android:textColor="@android:color/holo_red_dark"
    android:textSize="36sp" />

<TextView
    android:id="@+id/preco"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:background="@android:color/darker_gray"
    android:text="R$ 434,000"
    android:textAlignment="center"
    android:textColor="@android:color/holo_red_dark"
    android:textSize="36sp" />


    </LinearLayout>
    
asked by anonymous 20.08.2017 / 01:42

1 answer

1

Add

android:scaleType="centerCrop"

In your imageview, to stay the way you want, the image needs to be trimmed and centered

    
20.08.2017 / 02:03