+ Reply to Thread
Results 1 to 2 of 2

Thread: Set color for expandable list

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    8

    Set color for expandable list

    I just tried the current Google sample for ExpandableListiew: http://developer.android.com/resourc...ableList1.html

    This sample seem very simple and easy to use.

    But what I would like to do is to say that change back ground color for child element and group element. it doesn't uses any child_row.xml , group_row.xml. please tell me the right way to do.

    Thank a lot for any information.

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    10
    you can define new style for the expandable list view like below...
    Code:
    <style name="Widget.MyExpandable" parent="android:Widget.ExpandableListView">
            <item name="android:listSelector">@drawable/list_selector_background</item>
            <item name="android:divider">@color/ex_listview_stroke</item>
            <item name="android:cacheColorHint">@color/color_foreground</item>
            <item name="android:dividerHeight">0.5dp</item>
    </style>
    in hear list_selector_background is the drawable selector file in which you can define several states for the EXList view like stander and pressed etc...,

    and to have different background for the child and parent you need to create separate... drawable background file for childview.xml and parentview.xml

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts