0

i am referring this to implement 3 level expandable list. the code works fine. but my problem is , the items in the child elements not filled the whole area. because of that i cant expand the next child element by clicking on it.(i have to click the exact area which is child element text appeared)

here is the screen shot

can someone point me, where is the issue?

i have edit my xml view also as android:layout_width="fill_parent"

but didn't worked.. please help me on this. thank you.

EDIT

HERE THE ALL LAYOUT XML CODES.

ROOT

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ff5b5b"
android:orientation="vertical" >

<TextView
    android:id="@+id/itemRootTitle"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Large Text"
    android:textAppearance="?android:attr/textAppearanceLarge"
    tools:ignore="HardcodedText" />

  </LinearLayout>

PARENT

<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#40e0d0"
android:orientation="vertical" >

<TextView
    android:id="@+id/itemParentTitle"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Large Text"
    android:textAppearance="?android:attr/textAppearanceLarge"
    tools:ignore="HardcodedText" />

     </LinearLayout>

CHILD

<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#839096"
android:orientation="vertical" >

<TextView
    android:id="@+id/itemChildTitle"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Large Text"
    android:textAppearance="?android:attr/textAppearanceLarge"
    tools:ignore="HardcodedText" />

 </LinearLayout>

MAIN XML LAYOUT

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

<ExpandableListView
    android:id="@+id/expList"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:choiceMode="singleChoice"
     >

</ExpandableListView>

  </RelativeLayout>
Community
  • 1
  • 1
Darshana
  • 314
  • 2
  • 4
  • 22

1 Answers1

1

I also encountered this problem with a spinner I solved it like this

child xml.

<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#839096"
android:orientation="vertical" >

<TextView
    android:id="@+id/itemChildTitle"
    android:layout_width="match_parent" <== and this
    android:minWidth="500dp"  <=== add this
    android:layout_height="wrap_content"
    android:text="Large Text"
    android:textAppearance="?android:attr/textAppearanceLarge"
    tools:ignore="HardcodedText" />

 </LinearLayout>
Lena Bru
  • 13,521
  • 11
  • 61
  • 126