简体   繁体   中英

Android Expandable ListView Image

我正在关注一个列表视图的教程,该列表在这里 (第16节),我的问题是如何更改我拥有的每个类别的图标,例如,对于要测试1的图像,我想拥有不同的图像,对于测试2的图像要不同,并且以此类推。

The UI hierarchy for your group view is created in the getGroupView() method. If you want to change how things look, you should focus there.

From what I can see, you will probably need to expose a method for changing the icon in CheckedTextView .

Next, you'll need to implement some logic to determine the right icon per group. You can do that in a number of ways - you can check the name of each group and select the right drawable, or you can introduce another unique identifier to the group model class to help you decide which icon to show.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM