0

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.

F.M.
  • 243
  • 2
  • 8
  • 23
  • 1
    Remove the `padding`? – ci_ Sep 10 '15 at 13:12
  • No, nothing changes. For second and Third levels seems it's set wrap_content instead fill_parent. But code is correct. – F.M. Sep 10 '15 at 13:20
  • for 3 levels my suggestion is use tree list view please check https://github.com/Polidea/tree-view-list-android – Pavya Sep 10 '15 at 13:21
  • http://developer.android.com/reference/android/R.attr.html#expandableListPreferredItemPaddingLeft – arun Sep 10 '15 at 13:24
  • Not the anser, just a hint: `fill_parent` is **deprecated**. Use `match_parent` – Phantômaxx Sep 10 '15 at 13:28
  • @arun I do not understand your suggestion. my code already contain expandableListPreferredItemPaddingLeft val. I also try try to remove it, but the problem persist. – F.M. Sep 10 '15 at 15:28

0 Answers0