2014-02-21 26 views

回答

1

This是有很大幫助的。

代碼段:

對於state_empty,您可以設置不同的圖像是不 混亂,或者簡單地用透明的顏色來顯示什麼...

在加入這個項目你與人相處狀態繪製....

​​3210

所以,你的指標可以是這樣的:

<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/my_icon_max" /> 
    <item android:drawable="@drawable/my_icon_min" /> 
</selector> 

說明:

android:state_empty: - the element does not have any child 
android:state_expanded: - state when it is expanded 
android:drawable: - normal state, that is the cell has children but its not expanded 

這樣設置指標:

getExpandableListView().setGroupIndicator(getResources().getDrawable(R.drawable.indicator)); 
+1

高興它幫助。 ! –