2010-11-05 67 views
14

在ImageView縮小後仍然存在「空閒空間」,這種ImageView有些奇怪。ImageView之後的空白空間

<?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> 

一些屏幕:

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

模擬器
simulator http://img600.imageshack.us/img600/3023/simulator.png

和原始圖像:
original http://www.janissary.eu/img/obraz.jpg

爲什麼我會在圖像後獲得空間?

回答

0

你有沒有java代碼? 這可能是fillparent,wrapcontent的問題。我不知道你是如何佈置TextView和ImageView的。 或者,我的頭頂上,圖像文件可能有一個看不見的下半部分。製作圖像文件之前,我做過類似的錯誤。

+0

圖像很好。如果我改變fitstart的結果,圖像將在底部繪製,黑色空間將在頂部。 我認爲在java中沒有問題。它包含在main.xml中,並且水平填充並垂直包裝。 – Mikooos 2010-11-06 16:01:08