Possible Duplicate:
ExpandableListView - hide indicator for groups with no children
hide indicator for groups with no children
main.xml
<ExpandableListView
android:id="@+id/elv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:groupIndicator="@drawable/selector">
</ExpandableListView>
selector.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_empty="true" android:drawable="@android:color/transparent"/>
<item android:state_expanded="true" android:drawable="@drawable/expanded" />
<item android:drawable="@drawable/collapse" />
</selector>
it doesnt work for my ICS, it seems that the state of all collapsed groups are empty
Have a try at this :
getExpandableListView().setGroupIndicator(null);
Or else,
if ( getChildrenCount( groupPosition ) == 0 ) {
indicator.setVisibility( View.INVISIBLE );
}
else {
indicator.setVisibility( View.VISIBLE );
indicator.setImageResource( isExpanded ? R.drawable.group_expanded : R.drawable.group_closed );
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With