Search code examples
androidimagescale

Android: an image smaller that his real size


I have this code:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="top"
android:background="@drawable/db_bg_color">
<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:id="@+id/noise_bar_red"
    android:src="@drawable/noise_bar_red"
    android:contentDescription="@string/app_name"
    android:layout_centerHorizontal="true" />
<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:id="@+id/noise_bar"
    android:src="@drawable/noise_bar"
    android:contentDescription="@string/app_name"
    android:layout_centerHorizontal="true" />
</RelativeLayout>

the problem is that the last image, bigger like db_bg_color and like the screen, is something like scaled, i don't know... but it doesn't fill the screen... neither with fill_parent. See this: http://img835.imageshack.us/img835/7121/schermata20121203alle12.png Why?


Solution

  • I guess you can use:

    android:scaleType="fitXY"