Imageview scaling

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Imageview scaling

Postby BGH » Thu Jun 11, 2009 1:02 pm

I have an imageview as part of my layout with the following setup

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <ImageView
  3.                     android:id="@+id/vehiclePic"
  5.                             android:layout_width="fill_parent"
  7.                             android:layout_height="wrap_content"
  9.                             android:background="@android:color/white"
  11.                             android:padding="8px"
  13.                             android:scaleType="centerInside"
  15.                         />    
Parsed in 0.000 seconds, using GeSHi

Pretty standard stuff. The problem is that it isn't scaling the pic correctly. The image that I am using in the imageview is quite large and I just want it to scale to fit as best as possible on the small screen. With the above code it scales the pic the the size I want but I get massive borders above and below the actual pic.

See the pic I've attached. You can see the pic I want displayed but you can also see the unused space in the imageview above and below it. That unused space stretches about 3 screens worth both up and down. Am I doing something wrong? I've tried all the different scaleTypes and nothing seems to work.
1244721367533.png (76.18 KiB) Viewed 285 times
User avatar
Junior Developer
Junior Developer
Posts: 23
Joined: Thu Feb 12, 2009 3:51 am
Location: Melbourne, Australia


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests