I am using ListView and it has header and footer. The problem is that I need the list of items itself to be more narrow then a header. And I can't achieve that. The thing is that if I set paddings or margins to ListView, it will be set to list items, header and footer (the header and footer for some reason will be more narrow then list items). Settings margins just for item layout itself is no use. Here are the layouts:
main_layout.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
header_list_layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:inputType="textPersonName" />
</RelativeLayout>
footer_list_layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width ="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width ="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
list_item_layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:textStyle="bold"
android:textColor="@android:color/black"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</TextView>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent" >
</TextView>
</LinearLayout>
So what can I do to make everything right?
The image how I want it to look: