我正在制作一个应用程序,其中我必须在应用时使用组指示器图像显示放大图像。任何人都可以帮助我如何在可扩展 ListView 中设置指示器图像。任何帮助将不胜感激。
最佳答案
自定义可绘制对象可能就是您所需要的。您不能玩弄内置指示器。看看this .该页面底部的 group_indicator.xml 是自定义指标的示例。您只需将此可绘制对象添加到 expandablelistview 元素的 android:groupindicator 值中。通过这种方式,您可以控制指示器的行为和大小,如果组中没有 child ,还可以通过一些调整隐藏指示器。
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_empty="true" android:drawable="@drawable/arrowright">
<item android:state_expanded="true" android:drawable="@drawable/arrowdown">
<item android:drawable="@drawable/arrowright">
</item></item></item>
</selector>
希望对您有所帮助。
关于android:在可扩展 ListView 中设置指示器的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8339524/