Hi,

In my application I would like the user to be able to add a child to a
group of an expandable list by clicking on a button in the group
view.  I tried two different layouts for the group view.  When I use
the first layout (with the plain text Button) everything works as I
expected it to work.  Clicking on the group list item expands the list
and clicks on the button run the onClick for the button (which I set
in my own bindGroupView).

However, when I use an ImageButton in the layout instead of a Button,
clicks to the group view do not expand the list.  The only difference
I know of is just the button type.  Any idea what I'm doing wrong?
The image button is so much nicer looking, I'd really like to be able
to use it.

Thanks,
Roland

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:id="@+id/list_item" android:layout_width="fill_parent"
        android:orientation="horizontal" android:gravity="center_vertical"
        android:layout_height="52dip">

        <TextView android:text="List Name"
            android:id="@+id/name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:padding="8dip"
                android:layout_weight="1" android:layout_gravity="left"
                android:layout_marginLeft="?android:attr/
expandableListPreferredItemPaddingLeft" />

                <Button android:id="@+id/add_from_list_level"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" 
android:padding="9dip"
                        android:text="Add"
                        android:layout_gravity="right" android:focusable="false"
                        android:focusableInTouchMode="false" />

</LinearLayout>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:id="@+id/list_item" android:layout_width="fill_parent"
        android:orientation="horizontal" android:gravity="center_vertical"
        android:layout_height="52dip">

        <TextView android:text="List Name"
            android:id="@+id/name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:padding="8dip"
                android:layout_weight="1" android:layout_gravity="left"
                android:layout_marginLeft="?android:attr/
expandableListPreferredItemPaddingLeft" />

                <ImageButton android:id="@+id/add_from_list_level"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" 
android:padding="9dip"
                        android:src="@android:drawable/ic_input_add"
                        android:layout_gravity="right" android:focusable="false"
                        android:focusableInTouchMode="false" />
</LinearLayout>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to