ImageView后面留有空白区域

15

这个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
(来源:janissary.eu)

为什么在图片后面会有空格?

2个回答

45

0

你有Java代码吗? 这可能与fillparent、wrapcontent有关。我不知道你是如何布局TextView和ImageView的。 或者,就我个人而言,图片文件可能有一个不可见的下部分。在制作图像文件时,我以前也犯过类似的错误。


图片很好。如果我将fitstart更改为fitend,则图像将绘制在底部,黑色空间将位于顶部。我认为Java没有问题。它已包含在main.xml中,并水平填充并垂直包装。 - Mikooos

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接