Android的可扩展列表 [英] Android Expandable list
问题描述
我试图用一个自定义的 ExpandableListView
与父和子布局与父母XML和子XML。
I am trying to use a custom ExpandableListView
with parent and child layout with a parent XML and child XML.
我的数据会是一个服务器响应。所以我preferably想有数据数组列表或哈希地图父母和孩子的布局
My data would be a server response. So I preferably would like to have data in the form of an Array List or Hash-map for parent and child layouts
我随信附上了我想要的图像。
I am enclosing the images of what I want.
有没有办法来改变扩展列表箭头图像(默认)任何+或 - UI重新presentation如下图
Is there any way to change the expandable list arrow image(Default) by any + or - UI representation as shown below.
请提出一个教程或code逻辑,这种具体的情况。
Please suggest a tutorial or code logic for this specific situation .
推荐答案
在此期间 我已经创建了一个selector.xml为:
In the meanwhile I have created an selector.xml as:
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/friend_small"
android:state_expanded="true"/>
<item android:drawable="@drawable/place_small"/>
</selector>
和给出的Android版本:groupIndicator =@可绘制/选择器
XML格式 - friend_small,并把小是我的扩大图像和折叠状态
and given in android:groupIndicator="@drawable/selector"
in xml – friend_small and place small are my images of expand and collapsed state
这篇关于Android的可扩展列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!