Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blank space after ImageView

There is something weird about this ImageView, after big image scaled down there is still "free space".

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/bb"
    android:scaleType="fitStart" />
<TextView
    android:id="@+id/textMainBoxTitle"
    android:text="some text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1" />
</LinearLayout>

Some screens:

Eclipse:
eclipse http://img560.imageshack.us/img560/6218/eclipse.png

simulator:
simulator http://img600.imageshack.us/img600/3023/simulator.png

And the original image:
original
(source: janissary.eu)

Why am'I getting space after image?

like image 972
Mikooos Avatar asked Nov 05 '10 15:11

Mikooos


1 Answers

I found solution: How to scale an Image in ImageView to keep the aspect ratio

Gratzi wrote about android:adjustViewBounds="true" which fixes the isue.

like image 123
Mikooos Avatar answered Sep 22 '22 10:09

Mikooos