Reputation: 71
In this image the golden seprator line is not fit to the screen..i want this line to be fit to the screen...i used the fill_parent..but this gives me this kind of layout...
This is my custom xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/main"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_centerVertical="true" android:background="#000000">
<ImageView
android:id="@+id/imageView1"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="1dp"
android:src="@drawable/arrow" />
<LinearLayout
android:id="@+id/linear1"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true"
android:background="@drawable/seprater_line" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="TextView"
android:textColor="@android:color/white"
android:textSize="18sp" />
</RelativeLayout>
</RelativeLayout>
Upvotes: 0
Views: 156
Reputation: 7902
The divider of a ListView
is as wide as the ListView
itself. Looking at your screenshot, you have set some margins or padding to your ListView
which results in setting margin/padding for the divider too. Remove these attributes and your dividers will run over the whole width of the screen. By defining custom xml files for the rows themself, you can add your custom padding/margin there if you need it.
Upvotes: 1