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
  2.  
  3.                     android:id="@+id/vehiclePic"
  4.  
  5.                             android:layout_width="fill_parent"
  6.  
  7.                             android:layout_height="wrap_content"
  8.  
  9.                             android:background="@android:color/white"
  10.  
  11.                             android:padding="8px"
  12.  
  13.                             android:scaleType="centerInside"
  14.  
  15.                         />    
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


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.
Attachments
1244721367533.png
1244721367533.png (76.18 KiB) Viewed 151 times
User avatar
BGH
Junior Developer
Junior Developer
 
Posts: 23
Joined: Thu Feb 12, 2009 3:51 am
Location: Melbourne, Australia

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests