我正在尝试在 Android 中制作一个包含图像的 ListView。 我希望图像在列表中彼此对齐,但我似乎无法消除间距。
这是我的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>
你可以看到我在这里谈论的间距: http://imgbucket.info/img/kad67sjsg/stackoverflow.png
最佳答案
我解决了。
我缩小了图片的比例,成功了,所以问题甚至不在代码中。 感谢您的建议。
关于java - 删除 ListView 项之间的间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8417946/