Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove spacing between listview items

Tags:

java

android

xml

I am trying to make a ListView containing images in Android. I want the images to be right up against each other in the list, but I can't seem to get the spacing away.

Here is my 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>

and here is my 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>

You can see the spacing I am talking about here: http://imgbucket.info/img/kad67sjsg/stackoverflow.png

like image 544
JacobOJ Avatar asked Jun 18 '26 12:06

JacobOJ


1 Answers

I solved it.

I scaled the pictures down, which did the trick, so the problem wasn't even in the code. Thanks for your suggestions.

like image 79
JacobOJ Avatar answered Jun 21 '26 02:06

JacobOJ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!