Java 删除listview项之间的间距

Java 删除listview项之间的间距,java,android,xml,Java,Android,Xml,我试图在Android中创建一个包含图像的列表视图。 我想让图片在列表中相互对置,但我似乎无法消除间距 这是我的listview.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_pa

我试图在Android中创建一个包含图像的列表视图。 我想让图片在列表中相互对置,但我似乎无法消除间距

这是我的listview.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">    

<ListView
    android:id="@id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:drawSelectorOnTop="false"
    android:divider="@android:color/transparent"
    android:dividerHeight="0.0px"
    android:padding="0dip"
    android:layout_margin="0dip"
/>

</LinearLayout>

这是我的listrow.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/vw01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">    

<ImageView android:id="@+id/img01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="0dip"
    android:layout_margin="0dip"/>

</LinearLayout>

你可以看到我在这里谈论的间距: 我解决了它

我缩小了图片的比例,成功了,所以问题甚至不在代码中。
谢谢你的建议。

我觉得这个不错。你确定你的图像中没有透明像素吗?我觉得它也不错。这就是让我发疯的原因:)我很确定没有透明像素。我正在使用的图像如下:我不确定,但您是否尝试在列表行的线性布局中添加“minHeight=0dip”?我没有。你的布局xml帮助我删除了项目之间的黑色边框!谢谢,就像我写的,问题不在代码里。我使用图像编辑器缩小了图像文件的比例。谢谢这也帮了我的忙!