Expandablelistview layout not fill parent

271 Views Asked by At

I have an expandablelistview with 3 levels. Here my layout files:

activity_main.xml

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

        <ExpandableListView
         android:layout_width="fill_parent"
         android:id="@+id/ParentLevel"
         android:groupIndicator="@null"
         android:layout_height="wrap_content">
        </ExpandableListView>

    </LinearLayout>

load_deadlines_headers.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:padding="8dp"
    android:background="#addfff">

    <TextView
        android:id="@+id/Content1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
        android:textSize="17sp"
        android:textColor="#000000" />

</LinearLayout>

load_deadlines_children.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:padding="8dp"
    android:background="#addfff">


    <TextView
        android:id="@+id/Content2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
        android:textSize="17sp"
        android:textColor="#000000"/>


    <TextView
        android:id="@+id/Content3"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
        android:textColor="#000000"
        android:textSize="17sp" />

</LinearLayout>

load_deadlines_subchildren.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="8dp"
    android:background="#addfff">

    <TextView
        android:id="@+id/Content4"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="60dp"
        android:textSize="13sp"
        android:textColor="#000000" />
</LinearLayout>

Item of second and Third level of my expandable list ( load_deadlines_children.xml and load_deadlines_subchildren.xml ) does not fill parent for layout_width. I correctly specified

android:layout_width="fill_parent"

in code, but anyway it does not work. I looking for an advice about this trouble.

0

There are 0 best solutions below