1. Are you ready for the Galaxy S20? Here is everything we know so far!

Add image to parent only in ExpandableListView

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

  1. josipj

    josipj Lurker
    Thread Starter

    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
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...

Share This Page

Loading...