1. Check out our app, Forums for Android! Download and leave feedback here!

Add image to parent only in ExpandableListView

Discussion in 'Application Development' started by josipj, Nov 2, 2010.

  1. josipj

    josipj Member
    Thread Starter
    5

    Feb 8, 2009
    6
    0
    5
    Hi all,

    I'm having difficulty adding an image only to the parent of ExpandableListView. I know how to set a image for all items and use the visibility tag to make it visible or not.

    This is my parent xml:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:eek:rientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <ExpandableListView android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"/>

    <TextView android:id="@+id/android:empty"
    android:textSize="14px"
    android:textStyle="italic"
    android:layout_width="300px"
    android:layout_height="wrap_content"
    android:text="Geen files gevonden."/>

    </LinearLayout>

    And this is the child.xml
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout android:layout_width="fill_parent"
    android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">

    <TextView android:id="@+id/childname" android:paddingLeft="50px"
    android:textSize="20px" android:textStyle="italic"
    android:layout_width="105px" android:layout_height="wrap_content" />

    <ImageView android:id="@+id/ImageView01"
    android:layout_width="wrap_content" android:layout_height="wrap_content"
    android:src="@drawable/icon" android:visibility="invisible" />


    </LinearLayout>

    Because I waisted to much time on this one I just want to know if it is possible and how it would look like in the parent.xml

    Kind regards,

    Josip
     

    Advertisement

Share This Page

Loading...