【发布时间】:2012-03-14 12:08:54
【问题描述】:
我在 listView 上方有一个静态 ImageView。 但是 imageView 上面显示了一些空白区域。
我怎样才能删除这个空白空间?
-当我使用图像作为 TextView 的背景时,它在父顶部完美对齐
这是我的 ImageView xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/background_light"
>
<ImageView
android:id="@+id/titlebartear"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="-5dip"
android:src="@drawable/titlebartear"
/>
<ListView android:id="@android:id/list"
android:paddingTop="0px"
android:tag="fileslist"
android:fastScrollEnabled="true"
android:smoothScrollbar="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:divider="@color/pijndagboek_light_blue"
android:dividerHeight="2px"
android:cacheColorHint="#00000000"
android:layout_below="@id/titlebartear"
/>
</RelativeLayout>
【问题讨论】:
-
你试过android:scaleType参数吗? developer.android.com/reference/android/widget/… ; developer.android.com/reference/android/widget/…
-
你能发布你所有的 .xml 文件吗? (通常是它的 main.xml,但您可能已经更改了它。)问题可能出在文件的其他地方。
-
这是所有布局@JamesWright
-
谢谢。我不在 ym 笔记本电脑 atm 上,而是在学校电脑上,所以我不能将它复制到 eclipse 中并弄乱它来修复它。我想你在 laout_marginTop 属性中添加了尝试修复它?
-
谢谢!没有 marginTop 它向我展示了空白空间.. @JamesWright
标签: android xml user-interface listview imageview