Mehul
Mehul

Reputation: 71

The Seprator line is fill parent..i want to fit to the golden border...How can i do?

enter image description here

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

Answers (1)

DroidBender
DroidBender

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

Related Questions