Android : Reduce or no gap between a LinearLayout and a ListView in Android

on Tuesday, August 12, 2014


I have a LinearLayout and a ListView in one of the screens. There is a gape between them as in the picture. I want to reduce the gap. How can I do this?



Here is the image.






EDIT: I post my code also.



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#C4C4C4"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="0dp" >

<TextView
android:id="@+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_weight="1.05"
android:gravity="left"
android:text="@string/title"
android:textSize="24sp"
android:textStyle="bold" />

<ImageButton
android:id="@+id/checkCon"
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_marginBottom="5dp"
android:layout_marginRight="10dp"
android:adjustViewBounds="true"
android:background="#C4C4C4"
android:contentDescription="@string/title"
android:gravity="right"
android:scaleType="fitCenter"
android:src="@drawable/connect" />
</LinearLayout>

<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:padding="0dp" >
</ListView>

</LinearLayout>

0 comments:

Post a Comment