Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove extra space above and below imageView?

I have a really simple image within a RelativeLayout and for some reason I am getting extra spacing on the top and bottom which I can't remove. How can I clear it out?

Here is what it looks like:

Image from Eclipse preview

Here is the code:

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"         android:layout_width="match_parent"         android:layout_height="match_parent" >     <ImageView             android:id="@+id/imageView1"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignParentLeft="true"             android:layout_alignParentTop="true"             android:src="@drawable/slice11pp" /> </RelativeLayout> 
like image 625
UKDataGeek Avatar asked Feb 28 '13 18:02

UKDataGeek


2 Answers

Try this

android:adjustViewBounds="true"

like image 51
Sagar V. Avatar answered Sep 18 '22 14:09

Sagar V.


In your above imageView just add android:scaleType="fitXY"

like image 31
Kosh Avatar answered Sep 16 '22 14:09

Kosh