Android:ExpandableListview中的GroupIndicator图像显示不正常

时间:2014-05-09 09:03:51

标签: android image expandablelistview

我创建了一个自定义ExpandableListView的应用。我想把一个图像放在groupIndicator中。但我得知图像显示为向右拉长。图像的大小为100x100像素。如何将图像的宽度调整为可扩展行的大小?

main.xml中

<ExpandableListView
                    android:id="@+id/expandable"
                    style="@style/scrollbar"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:groupIndicator="@drawable/expandable"
                    android:listSelector="@color/negro"
                    android:adjustViewBounds="true"
                    android:padding="0dp"
                    android:scrollingCache="false" />

expandable.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:drawable="@drawable/expandable_icono_abajo" android:state_empty="true"/>
  <item android:drawable="@drawable/expandable_icono_arriba" android:state_expanded="true"/>
  <item android:drawable="@drawable/expandable_icono_abajo" />
</selector>

1 个答案:

答案 0 :(得分:0)

添加

android:indicatorLeft="<some left padded value>dp"
android:indicatorRight="<left value + 100>dp"

ExpandableListView